Skip to content

Conversation

@max-leuthaeuser
Copy link
Contributor

@max-leuthaeuser max-leuthaeuser commented Nov 20, 2025

This PR puts expressions from TS class annotation into the respective constructor blocks.

Not actually a fix but as we cannot handle annotation parameter w.r.t. data-flow this at least stops crashing the backend.
Copy link
Contributor

@maltek maltek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that the minimal example I provided you was a bit too minimal: the original customer code used some complex expressions inside the NgModule() annotation, which contained a lambda somewhere deep down. This check won't catch that.

I think the root cause is putting arbitrary expressions below Annotation nodes to begin with. These nodes were only meant for pure compile-time constructs like in Java, and should not contain arbitrary expressions with side-effects. E.g. pythonsrc lowers decorators to method calls and doesn't use annotation nodes at all.

That's a larger change where we have to tread carefully with compatibility of backend passes, but it may be unavoidable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants