Created
December 13, 2016 16:55
-
-
Save Sfshaza/6415c7265655e6eb71924ea984d95995 to your computer and use it in GitHub Desktop.
Sound Dart Guide: unsound example
This file contains 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