-
-
Notifications
You must be signed in to change notification settings - Fork 676
Private getters/setters #12204
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
Private getters/setters #12204
Conversation
Nice! I still can't remember if we ever agreed to actually do this, but I'll just make the executive decision to merge it if CI agrees. I scrolled through the changes and it looks good, though it's not super easy to review something like this because it affects so many places and at the same time doesn't since One question: should Also, a follow-up I'd like to look into later: I hate that |
and make different property access error more readable
Nobody protested so let's do this. |
@@ -1126,6 +1126,7 @@ and encode_var_access a = | |||
| AccInline -> 5, [] | |||
| AccRequire (s,msg) -> 6, [encode_string s; null encode_string msg] | |||
| AccCtor -> 7, [] | |||
| AccPrivateCall -> 8, [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for the next time you deal with macro encode/decode: those values are linked to the order of the enum values (here, haxe.macro.Type.VarAccess
) so changes need to reflect that.
Fixed with 54ce7ff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and yeah it's on us for not properly code reviewing °°)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And by us he means me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And by us he means me!
Well I should also have reviewed this properly 😅 I had a month (was not available for some of it, but not all)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok I forgive you!
var prop(private get, private set)
syntax implementation.There is many places where this read/write check can be done, so not sure if i did it correctly.
Currently errors highlights full
obj.prop
expression instead ofprop
part.I also added unification from
(private get/set)
to(get/set)
for interfaces, so you can have read-only field in interface and implement it as read-write, like in other langs.Closes #3053