Closed
Description
This tracker is for issues related to:
-
dart2js
-
Dart SDK Version (
dart --version
)
2.4.1
TLDR:
Minification changes generic type names which could lead to problems if they're hardcoded.
Example code:
class A {}
void doSmth<T>() {
switch(T) {
case A:
// This will never be reached since during runtime,
// T might be mB or some other minified string
doSmthElse();
break;
}
}
doSmth<A>();
Proposed solution:
Don't minify generic type names.
Are there any workarounds? I've tried using enums but it doesn't work like Typescript..