You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure about the spec here. Is the annotation really needed on the redef? If yes, shouldn't the error message be more explicative? Either the spec or the compiler is wrong here.
Then when setting the default value of optional (with the annotation obviously):
varb = newB("ba")printb.foo
I expected the previous piece of code to display ba but it display bar.
So the attribute is allowed as optional in the constructor but the passed value is never assigned.
Here again, I'm not sure about the spec of this annotation.
The text was updated successfully, but these errors were encountered:
Two questions in one.
First when redefining an
optional
attribute:Without the
optional
annotation on the redef, the compiler will return:With the annotation, no problem.
I'm not sure about the spec here. Is the annotation really needed on the redef? If yes, shouldn't the error message be more explicative? Either the spec or the compiler is wrong here.
Then when setting the default value of optional (with the annotation obviously):
I expected the previous piece of code to display
ba
but it displaybar
.So the attribute is allowed as optional in the constructor but the passed value is never assigned.
Here again, I'm not sure about the spec of this annotation.
The text was updated successfully, but these errors were encountered: