Open tsteckenborn opened 9 months ago
This issue has not been updated in a while. If it is still relevant, please comment on it to keep it open. The issue will be closed soon if it remains inactive.
Potentially any updates on this? A first step could be just typing them as the base type, e.g. string for now?
Hi Tobias,
sorry for the long silence. I'm afraid there has been no work done on this issue so far.
I am actually wondering if this use case is valid. When I replace the inline enum with a named one, I am seeing an error:
type hierarchyLevel: String enum {
oneTaggedElementHierarchyLevel
}
entity Something {
key elementGuid: String;
taggedElements: Composition of many hierarchyLevel // Expecting an entity or aspect as composition targetCDS (compiler)(ref-invalid-target)
}
It reads like the same should apply for inline-defined enums. So it kind of reads like your example should already be rejected by the compiler. I will investigate on this.
Best Daniel
EDIT: I have misread your initial example, thanks for pointing that out. The following code works as expected:
type hierarchyLevel: String enum {
oneTaggedElementHierarchyLevel
};
entity Something.taggedElements {
hierarchyLevel: hierarchyLevel;
key elementGuid: String;
}
entity Something {
taggedElements: Composition of many Something.taggedElements
}
I can reproduce the issue. As users can use a named enum to work around this problem, I'd like to prioritise it fairly low. If you see an immediate solution and think this should be addressed asap, I would welcome any PR.
Is there an existing issue for this?
Nature of Your Project
TypeScript
Current Behavior
Given cds such as:
The following type is generated:
Yet
taggedElements_hierarchyLevel
is not defined.Expected Behavior
I would've expected
taggedElements_hierarchyLevel
to exist.Steps To Reproduce
No response
Environment
Repository Containing a Minimal Reproducible Example
No response
Anything else?
No response