cds-typer icon indicating copy to clipboard operation
cds-typer copied to clipboard

[BUG][Regression] Incorrect types generated with composition of many

Open tsteckenborn opened this issue 10 months ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Nature of Your Project

TypeScript

Current Behavior

(Could be related to earlier behavior in #183)

Given a definition such as:

service TestService {
    entity testNamespace.Test {
        key id              : String;
            testComposition : Composition of many {
                                  key id : String;
                              };
    }

    entity Test as projection on testNamespace.Test;
}

Leads in the @cds-models/TestService/index.ts to:

// ...
  return class Test extends Base {
        id?: string;
        testComposition?: __.Composition.of.many<__.DeepRequired<TestService.testNamespace.Test>['testComposition']>;
      static readonly actions: Record<never, never>
  };
}
// ...

With <__.DeepRequired<TestService < --- Cannot find namespace 'TestService'.ts(2503)

Expected Behavior

Would've expected the generated types be correct.

Steps To Reproduce

See above

Environment

- **OS**: MacOS
- **Node**: 20.12.2
- **npm**: /
- **cds-typer**: 20.0.1
- **cds**: 7.8.1

Repository Containing a Minimal Reproducible Example

No response

Anything else?

No response

tsteckenborn avatar Apr 25 '24 12:04 tsteckenborn