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
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")); | |
} |
OlderNewer