Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decorators aren't applied to templated types #6801

Open
tadfisher opened this issue Apr 1, 2025 · 1 comment
Open

Decorators aren't applied to templated types #6801

tadfisher opened this issue Apr 1, 2025 · 1 comment

Comments

@tadfisher
Copy link

Writing an emitter for a target language that understands template arguments, I want decorators to apply to the template type itself so I can change how the type is emitted; for example, changing a model's field names. Currently my decorator function is called only for the derived types, so I will see several stateMap entries for "finished" versions of the template type and not the template type itself. The cause of this was difficult to track down and rather confusing.

@timotheeguerin
Copy link
Member

This is by design, templates are only available as instance in any reference.

Most decorators also will not expect receiving a non finished template, leading in crashes.

It does seem however we are lacking this in our template documentation.

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

No branches or pull requests

2 participants