Skip to content

Instantly share code, notes, and snippets.

@Sfshaza
Created December 13, 2016 16:55
Show Gist options
  • Save Sfshaza/6415c7265655e6eb71924ea984d95995 to your computer and use it in GitHub Desktop.
Save Sfshaza/6415c7265655e6eb71924ea984d95995 to your computer and use it in GitHub Desktop.
Sound Dart Guide: unsound example
// The code passes static non-strong mode static analysis.
// Enable strong mode by clicking Strong mode checkbox in lower right.
// The code now raises a warning.
void fn(List<int> a) {
print(a);
}
main() {
var list = []; // Add <int> before the [] to pass strong mode
list.add(1);
list.add(2);
fn(list);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment