-
Notifications
You must be signed in to change notification settings - Fork 32
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
Loop in class building prevent compiler termination #55
Comments
Any preference ? |
Ideally this should be done automatically without the user having to tag such cases. |
What would be the downside of systematically storing vars as |
Extra runtime type check at every access
Le mer. 21 avr. 2021 à 20:20, trethaller ***@***.***> a
écrit :
… What would be the downside of systematically storing vars as Serializable
and performing casts in the get/set functions?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#55 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHZXQFM7VFM7BT73SQF5ADTJ4JOTANCNFSM4YU5TITA>
.
|
I'm wondering how much of a problem that is for ref fields. I see that it would be too bad for things like x,y,z, but not sure we actually have performance critical code using @:s refs? |
I would need a reproducible example so I can fix that :) |
When a serializable class ends-up referencing itself in its graph of references, this error can occur:
Loop in class building prevent compiler termination
The current workaround is to declare the reference of an more abstract type, eg, Serializable, and add strongly typed get/set.
Should this be standardized? For example:
@:s(sub) var subRef : MyClass;
@:storeAs(ParentClass) @:s var subRef : MyClass;
@:selfRef @:s var subRef : MyClass;
The text was updated successfully, but these errors were encountered: