This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Description
Bug Report or Feature Request (mark with an x)
- [X] bug report -> please search issues before submitting
- [ ] feature request
Area
- [X] devkit
- [ ] schematics
Versions
Repro steps
An enum member can contain an initializer which may have side effects. Currently all enums are wrapping in an IIFE and annotated with PURE which will prevent the side effects from occurring if the enum is unused.
function getValue() {
console.log('hi');
return 6;
}
enum Test {
ValueA,
ValueB = getValue()
}
Desired functionality
As this will most likely be an extremely rare occurrence, a documentation note may suffice. Additionally a warning or informational message may also be useful when an enum is encountered with a member containing a non-constant expression.
Mention any other details that might be useful