-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Getters in mixins get serialized to property accessors #58790
Comments
the problem is that that combined property is created here: https://github.dev/microsoft/TypeScript/blob/f5238c328e553df2c0af868173dfd3789d77205f/src/compiler/checker.ts#L15089 |
Also of note, this does not affect static getters, only instance getters. |
If anyone is looking for a super silly work around ,you can wrap the mixin function and cast it with the appropriate getters. It's not ideal, but at least it doesn't break builds. EDIT: The downside is because the transform isn't "homomorphic" you lose out on comments set in your mixin. |
π Search Terms
Getters, mixins, classes
π Version & Regression Information
β― Playground Link
https://tsplay.dev/mA0RkN
π» Code
Output
Compiler Options
Playground Link: Provided
π Actual behavior
The mixin creates a property accessor instead of a getter
π Expected behavior
The mixin should create a getter and not a property accessor
Additional information about the issue
Seems related:
#54879 (comment)
Duplicate of: #44938
The text was updated successfully, but these errors were encountered: