Last active
December 13, 2016 16:48
-
-
Save Sfshaza/a992c189acd379b6d6fcda41269208e9 to your computer and use it in GitHub Desktop.
Sound Dart Guide: unsound example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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