Skip to content

Instantly share code, notes, and snippets.

@bsutton
Created June 14, 2020 07:44
Show Gist options
  • Save bsutton/cf6d285f6b0dc34e2db23e9a40ffbd01 to your computer and use it in GitHub Desktop.
Save bsutton/cf6d285f6b0dc34e2db23e9a40ffbd01 to your computer and use it in GitHub Desktop.
non-null use after null check should not generate an error
class A
{
String? get startScriptPath => null;
bool addToPath(String path) {
if (startScriptPath != null) {
if (!exists(startScriptPath)) {
print('hi');
}
} else {
throw UnsupportedError(
"The shell oesn't support a start script so we can't configure the path");
}
return true;
}
bool exists(String path) => true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment