-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vm/aot] co19/LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_enum_A01_t01 Crash #52422
Comments
Possibly related to db89fe0? @alexmarkov Could you take a look? |
I already have a fix: https://dart-review.googlesource.com/c/sdk/+/304002 |
Hm, the test is an enum with type arguments: import "../../../Utils/expect.dart";
enum E<T> {
a<int>(),
b<String>(),
c<double>(),
}
String test1(E<num> e) {
switch (e) {
case E.a:
case E.c:
return "ok";
}
}
String test2(E<num> e) =>
switch (e) {
E.a => "a",
E.c => "c"
};
main() {
Expect.equals("ok", test1(E.a));
Expect.equals("ok", test1(E.c));
Expect.equals("a", test2(E.a));
Expect.equals("c", test2(E.c));
} TIL that we can have type arguments in enum values. 🤯 We're doing I wouldn't think the type arguments are important at all here. Wouldn't you want to check instance equality rather than the type? From reading the code&comments, it looks like enums should be jump tables instead of binary search? |
…itches" This reverts commit 43ce548. Reason for revert: test failures on vm-aot-*-product-* bots. Original change's description: > [vm/compiler] Remove unnecessary type check from optimized switches > > Switch optimization now relies on static type of the tested value, > so it is safe to omit the type check (with sound null safety) or > reduce it to a null check (without sound null safety). > > TEST=co19/LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_enum_A01_t01 > Fixes #52422 > > Change-Id: Ic93f4f212bee9ed3bfe5035f3c8d7535274c2f63 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304102 > Commit-Queue: Alexander Markov <alexmarkov@google.com> > Reviewed-by: Alexander Aprelev <aam@google.com> Change-Id: Ifa6ee75be49f7264fa4dfc08183d5ccb731c60d1 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304321 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Alexander Markov <alexmarkov@google.com>
…itches" This is a reland of commit 43ce548 In addition to removing type check, switch range checks are adjusted in order to avoid call to 'int.operator<=', which can be removed by tree shaker in AOT/product mode, causing NoSuchMethodError at runtime. Original change's description: > [vm/compiler] Remove unnecessary type check from optimized switches > > Switch optimization now relies on static type of the tested value, > so it is safe to omit the type check (with sound null safety) or > reduce it to a null check (without sound null safety). > > TEST=co19/LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_enum_A01_t01 > Fixes #52422 > > Change-Id: Ic93f4f212bee9ed3bfe5035f3c8d7535274c2f63 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304102 > Commit-Queue: Alexander Markov <alexmarkov@google.com> > Reviewed-by: Alexander Aprelev <aam@google.com> TEST=co19/LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_enum_A01_t01 TEST=language/async/switch_test Change-Id: I70bf480bf376f946d66caa504120c8f85093ea8d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304322 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
There are new test failures on Issue 52409. Reading a Never typed getter makes the flow unreachable....[parser] Fix issue 52365 about parsing parenthesised functions followed by >> etc.
The tests
are failing on configurations
log
repro:
$ tools/build.py -ax64 dart_precompiled_runtime create_platform_sdk && tools/test.py -n vm-aot-linux-debug-x64 co19/LanguageFeatures/Patterns/Exhaustiveness/exhaustiveness_enum_A01_t01 -k
The text was updated successfully, but these errors were encountered: