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
In general, overriding fields is a bad idea in Dart. Both fields exist, but the one on the super class is only accessible through an explicit super.<field> invocation.
In particular in this case, it is much worse since the subclass declares the field as final, it only overrides the getter, and not the setter. So there is a setter still, which assigns to the base class field, which can never be read (except through a super. invocation in the subclass).
In this case, the subclass does try to set the configLookup field, which has no effect, because that field is never read.
The text was updated successfully, but these errors were encountered:
Note that this causes a failure in DDC when null safety asserts are enabled, dart-lang/sdk#50569. That is technically a compiler bug, but it highlighted this pattern which is almost certainly not doing what was intended.
See
antlr4/runtime/Dart/lib/src/atn/src/atn_config_set.dart
Line 290 in 47415e3
In general, overriding fields is a bad idea in Dart. Both fields exist, but the one on the super class is only accessible through an explicit
super.<field>
invocation.In particular in this case, it is much worse since the subclass declares the field as final, it only overrides the getter, and not the setter. So there is a setter still, which assigns to the base class field, which can never be read (except through a
super.
invocation in the subclass).In this case, the subclass does try to set the
configLookup
field, which has no effect, because that field is never read.The text was updated successfully, but these errors were encountered: