With --enable-experiment=non-nullable, the following code has a parse error:
class A {
int? b = 1;
}
main() {
var a = A();
print(a!.b); // ERROR: Expected to find ')'
}
Note: I discovered this while trying to confirm whether we support ! in cascade expressions, e.g. a..foo()!.bar=3; (see discussion at dart-lang/language#293 (comment)). So we should double check this case too when fixing the bug.