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
void main() {
const name = null;
final result = greeting(name);
print(result);
}
String greeting(String name) {
return 'Hello $name';
}
gives the following runtime error:
type 'Null' is not a subtype of type 'String'
I suppose this is an error because of the inferred dynamic type and not with null safety itself, but it would be nice if static analysis could at least give a warning.