You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a CDS file in which I declare an Entity named "Record".
If I run cds-typer, then an exception occurs:
***masked*** error TS2315: Type 'Record' is not generic.
at Plugin.build (***masked***\node_modules\@cap-js\cds-typer\cds-plugin.js:139:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Promise.allSettled (index 0)
at async BuildTaskEngine._executePipeline (***masked***\node_modules\@sap\cds-dk\lib\build\buildTaskEngine.js:159:29)
at async BuildTaskEngine._executeBuildTasks (***masked***\node_modules\@sap\cds-dk\lib\build\buildTaskEngine.js:150:25)
at async BuildTaskEngine.processTasks (***masked***\node_modules\@sap\cds-dk\lib\build\buildTaskEngine.js:59:33)
at async build (***masked***\node_modules\@sap\cds-dk\lib\build\index.js:19:16)
at async Object.build (***masked***\node_modules\@sap\cds-dk\bin\build.js:171:5)
at async Object.exec (***masked***\node_modules\@sap\cds-dk\bin\cds.js:91:16)
The generated Code looks like this:
export class Record extends _RecordAspect(__.Entity) {}
Object.defineProperty(Record, 'name', { value: 'srv.Records' })
Object.defineProperty(Record, 'is_singular', { value: true })
export class Records extends Array<Record> {$count?: number}
Object.defineProperty(Records, 'name', { value: 'srv.Records' })
This defined class "Record" overwrites the TypeScript Record type.
This leads to the TS-Error because the "wrong" Record will be used.
Expected Behavior
I can define a CDS-Entity named "Record" and the TS-Code ist generated correctly.
Is there an existing issue for this?
Nature of Your Project
TypeScript
Current Behavior
I have a CDS file in which I declare an Entity named "Record".
If I run cds-typer, then an exception occurs:
The generated Code looks like this:
This defined class "Record" overwrites the TypeScript Record type.
This leads to the TS-Error because the "wrong" Record will be used.
Expected Behavior
I can define a CDS-Entity named "Record" and the TS-Code ist generated correctly.
Steps To Reproduce
Environment
Repository Containing a Minimal Reproducible Example
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: