-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
simpleclub/math_keyboard
#73Labels
area-dart2wasmIssues for the dart2wasm compiler.Issues for the dart2wasm compiler.area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
A switch statement on a dynamic
value tries to cast the value to a type, when all (non-default) cases are matching that type.
Reproducable Code:
void main() {
dynamic number = 42;
switch (number) {
case 'a':
print('a');
case 'b':
print('b');
default:
print('default');
}
}
This code works on web with JS, but fails when running with --wasm
.
Expected behaviour:
prints out default
.
Actual behaviour:
Uncaught RuntimeError: illegal cast
When adding a case of any other type than String
it works.
I thought this would be fixed by #56321, but this is still happening.
dart --version
output:
Dart SDK version: 3.6.0 (stable) (Thu Dec 5 07:46:24 2024 -0800) on "macos_arm64"
Metadata
Metadata
Assignees
Labels
area-dart2wasmIssues for the dart2wasm compiler.Issues for the dart2wasm compiler.area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)