Skip to content

Instantly share code, notes, and snippets.

View kakikubo's full-sized avatar

kakikubo kakikubo

View GitHub Profile
@kakikubo
kakikubo / main.dart
Created March 6, 2022 21:08
動的型付け言語のように動く
dynamic addOne(number) {
return 1 + number;
}
void main() {
print(addOne(1));
// 以下は実行するとエラーが起きる(ビルドは通る)
// Uncaught Error: TypeError: "1": type 'JSString' is not a subtype of type 'num'
print(addOne("1"));
}