Open
Description
Running the following code
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.