Skip to content

Instantly share code, notes, and snippets.

@ArtemGr
Created December 11, 2019 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArtemGr/10ebe4bb74a11fe6e68efb351af40d1a to your computer and use it in GitHub Desktop.
Save ArtemGr/10ebe4bb74a11fe6e68efb351af40d1a to your computer and use it in GitHub Desktop.
stackoverflow-33424185-1
// 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