Created
December 11, 2019 05:18
-
-
Save ArtemGr/10ebe4bb74a11fe6e68efb351af40d1a to your computer and use it in GitHub Desktop.
stackoverflow-33424185-1
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
// https://stackoverflow.com/questions/33424185/why-are-incorrect-type-assignments-allowed-in-dart | |
void main() { | |
String str = "test"; | |
int integer = 5; | |
double decimal = 1.5; | |
List list = [1,2,3]; | |
String s = decimal; print(s); // 1.5 | |
int i = str; print(i); // test | |
double d = list; print(d); // [1, 2, 3] | |
List l = integer; print(l); // 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment