-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
The current semantics of exp?.x are described in terms of evaluating this:
((a) => a == null ? null : a.x)(exp)Because static fields cannot be read as instance members, this implies that we cannot use ?. with statics. Similarly, because we don't have first class libraries, we cannot use ?. with prefixes either.
This seems to match what the 07 test in conditional_property_access_test.dart checks, but I wanted to confirm before I implement this in dart2js.
This surprised me a little bit though. I was expecting that C?.x would be valid, it would issue a warning (e.g. "null-aware operators are not useful with statics"), but would otherwise execute as if the user had written C.x.
@gbracha @stereotype441 - what are your thoughts on switching to the latter?
Metadata
Metadata
Assignees
Labels
No labels