Skip to content

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

@tsteckenborn

Description

@tsteckenborn

Is there an existing issue for this?

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingkeepaliveWill not be closed by Stale bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions