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 think the type system is too conservative for final fields:
classFoo {
finalObject object;
Foo(this.object);
voidbar() {
if (object isString) {
print(object.length); // The getter 'length' isn't defined for the type 'Object'.
}
}
}
Similarly for null type promotion:
classBar {
finalString? message;
Bar([this.message]);
voidbar() {
if (message !=null) {
print(message.length); // An expression whose value can be 'null' must be null-checked before it can be dereferenced.
}
}
}
Having to copy to a local variable before testing and accessing is cumbersome.
I think the type system is too conservative for final fields:
Similarly for null type promotion:
Having to copy to a local variable before testing and accessing is cumbersome.
The text was updated successfully, but these errors were encountered: