In it, the variable e has static type int?. It is my understanding that the expression e - 1 in the line containing 0: ? e - 1, is analyzed independently from the null-aware marker ? preceding it. In that expression, e has static type int?, which makes the expression e - 1 a compile-time error.
Should the line containing 0: ? e - 1, trigger a compile-time error message?
Consider the following excerpt from a test:
https://github.com/dart-lang/co19/blob/c09143e5adfb0779a9708792696b6ee64fbec0b3/LanguageFeatures/Control-flow-collections/Null-aware-elements/syntax_A03_t01.dart#L51-L56
In it, the variable
e
has static typeint?
. It is my understanding that the expressione - 1
in the line containing0: ? e - 1,
is analyzed independently from the null-aware marker?
preceding it. In that expression,e
has static typeint?
, which makes the expressione - 1
a compile-time error.Should the line containing
0: ? e - 1,
trigger a compile-time error message?/cc @eernstg @sgrekhov