Skip to content

Instantly share code, notes, and snippets.

@ArtemGr
Created Dec 11, 2019
Embed
What would you like to do?
stackoverflow-33424185-2
// https://stackoverflow.com/questions/33424185/why-are-incorrect-type-assignments-allowed-in-dart
void main() {
Map<String, dynamic> map = {
'str': 'test',
'integer': 5,
'decimal': 1.5,
'list': [1,2,3]
};
String s = map['decimal']; print(s); // JSDouble not String
int i = map['str']; print(i); // JSString not int
double d = map['list']; print(d); // JSArray not double
List l = map['integer']; print(l); // JSInt not List
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment