| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:22:11: Error: The type 'Enum' is not exhaustively matched by the switch cases. |
| // - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'. |
| // Try adding a default case or cases that match Enum.c. |
| // switch (e) /* Error */ { |
| // ^ |
| // |
| // pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:33:11: Error: The type 'Enum' is not exhaustively matched by the switch cases. |
| // - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'. |
| // Try adding a default case or cases that match Enum.b. |
| // switch (e) /* Error */ { |
| // ^ |
| // |
| // pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:44:11: Error: The type 'Enum' is not exhaustively matched by the switch cases. |
| // - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'. |
| // Try adding a default case or cases that match Enum.a. |
| // switch (e) /* Error */ { |
| // ^ |
| // |
| // pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:55:11: Error: The type 'Enum' is not exhaustively matched by the switch cases. |
| // - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'. |
| // Try adding a default case or cases that match Enum.a. |
| // switch (e) /* Error */ { |
| // ^ |
| // |
| // pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:91:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases. |
| // - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'. |
| // Try adding a default case or cases that match Null. |
| // switch (e) /* Error */ { |
| // ^ |
| // |
| // pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:105:11: Error: The type 'Enum?' is not exhaustively matched by the switch cases. |
| // - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'. |
| // Try adding a default case or cases that match Enum.b. |
| // switch (e) /* Error */ { |
| // ^ |
| // |
| // pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart:136:11: Error: The type 'Enum' is not exhaustively matched by the switch cases. |
| // - 'Enum' is from 'pkg/front_end/testcases/patterns/exhaustiveness/enum_switch.dart'. |
| // Try adding a default case or cases that match Enum.c. |
| // switch (e) /* Non-exhaustive */ { |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class Enum extends core::_Enum /*isEnum*/ { |
| static const field core::List<self::Enum> values = #C10; |
| enum-element static const field self::Enum a = #C3; |
| enum-element static const field self::Enum b = #C6; |
| enum-element static const field self::Enum c = #C9; |
| const constructor •(core::int #index, core::String #name) → self::Enum |
| : super core::_Enum::•(#index, #name) |
| ; |
| method _enumToString() → core::String |
| return "Enum.${this.{core::_Enum::_name}{core::String}}"; |
| } |
| class GenericEnum<T extends core::Object? = dynamic> extends core::_Enum /*isEnum*/ { |
| static const field core::List<self::GenericEnum<dynamic>> values = #C14; |
| enum-element static const field self::GenericEnum<core::int> a = #C11; |
| enum-element static const field self::GenericEnum<core::String> b = #C12; |
| enum-element static const field self::GenericEnum<core::bool> c = #C13; |
| const constructor •(core::int #index, core::String #name) → self::GenericEnum<self::GenericEnum::T%> |
| : super core::_Enum::•(#index, #name) |
| ; |
| method _enumToString() → core::String |
| return "GenericEnum.${this.{core::_Enum::_name}{core::String}}"; |
| } |
| static method exhaustiveSwitch(self::Enum e) → void { |
| #L1: |
| { |
| final synthesized self::Enum #0#0 = e; |
| if(#C3 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("a"); |
| break #L1; |
| } |
| } |
| else |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L1; |
| } |
| } |
| else |
| if(#C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("c"); |
| break #L1; |
| } |
| } |
| } |
| } |
| static method nonExhaustiveSwitch1(self::Enum e) → void { |
| #L2: |
| { |
| final synthesized self::Enum #0#0 = e; |
| if(#C3 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("a"); |
| break #L2; |
| } |
| } |
| else |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L2; |
| } |
| } |
| } |
| } |
| static method nonExhaustiveSwitch2(self::Enum e) → void { |
| #L3: |
| { |
| final synthesized self::Enum #0#0 = e; |
| if(#C3 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("a"); |
| break #L3; |
| } |
| } |
| else |
| if(#C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("c"); |
| break #L3; |
| } |
| } |
| } |
| } |
| static method nonExhaustiveSwitch3(self::Enum e) → void { |
| #L4: |
| { |
| final synthesized self::Enum #0#0 = e; |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L4; |
| } |
| } |
| else |
| if(#C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("c"); |
| break #L4; |
| } |
| } |
| } |
| } |
| static method nonExhaustiveSwitch4(self::Enum e) → void { |
| #L5: |
| { |
| final synthesized self::Enum #0#0 = e; |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L5; |
| } |
| } |
| } |
| } |
| static method nonExhaustiveSwitchWithDefault(self::Enum e) → void { |
| #L6: |
| { |
| final synthesized self::Enum #0#0 = e; |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L6; |
| } |
| } |
| else { |
| { |
| core::print("a|c"); |
| break #L6; |
| } |
| } |
| } |
| } |
| static method exhaustiveNullableSwitch(self::Enum? e) → void { |
| #L7: |
| { |
| final synthesized self::Enum? #0#0 = e; |
| if(#C3 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("a"); |
| break #L7; |
| } |
| } |
| else |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L7; |
| } |
| } |
| else |
| if(#C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("c"); |
| break #L7; |
| } |
| } |
| else |
| if(#0#0 == null) { |
| { |
| core::print("null"); |
| break #L7; |
| } |
| } |
| } |
| } |
| static method nonExhaustiveNullableSwitch1(self::Enum? e) → void { |
| #L8: |
| { |
| final synthesized self::Enum? #0#0 = e; |
| if(#C3 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("a"); |
| break #L8; |
| } |
| } |
| else |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L8; |
| } |
| } |
| else |
| if(#C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("c"); |
| break #L8; |
| } |
| } |
| } |
| } |
| static method nonExhaustiveNullableSwitch2(self::Enum? e) → void { |
| #L9: |
| { |
| final synthesized self::Enum? #0#0 = e; |
| if(#C3 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("a"); |
| break #L9; |
| } |
| } |
| else |
| if(#C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("c"); |
| break #L9; |
| } |
| } |
| else |
| if(#0#0 == null) { |
| { |
| core::print("null"); |
| break #L9; |
| } |
| } |
| } |
| } |
| static method unreachableCase1(self::Enum e) → void { |
| #L10: |
| { |
| final synthesized self::Enum #0#0 = e; |
| late final synthesized core::bool #0#2 = #C3 =={core::Object::==}{(core::Object) → core::bool} #0#0; |
| if(#0#2) { |
| { |
| core::print("a1"); |
| break #L10; |
| } |
| } |
| else |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L10; |
| } |
| } |
| else |
| if(#0#2) { |
| { |
| core::print("a2"); |
| break #L10; |
| } |
| } |
| else |
| if(#C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("c"); |
| break #L10; |
| } |
| } |
| } |
| } |
| static method unreachableCase2(self::Enum e) → void { |
| #L11: |
| { |
| final synthesized self::Enum #0#0 = e; |
| late final synthesized core::bool #0#2 = #C3 =={core::Object::==}{(core::Object) → core::bool} #0#0; |
| if(#0#2) { |
| { |
| core::print("a1"); |
| break #L11; |
| } |
| } |
| else |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L11; |
| } |
| } |
| else |
| if(#0#2) { |
| { |
| core::print("a2"); |
| break #L11; |
| } |
| } |
| } |
| } |
| static method unreachableCase3(self::Enum e) → void { |
| #L12: |
| { |
| final synthesized self::Enum #0#0 = e; |
| if(#C3 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("a"); |
| break #L12; |
| } |
| } |
| else |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L12; |
| } |
| } |
| else |
| if(#C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("c"); |
| break #L12; |
| } |
| } |
| else |
| if(#0#0 == null) { |
| { |
| core::print("null"); |
| break #L12; |
| } |
| } |
| } |
| } |
| static method unreachableCase4(self::Enum? e) → void { |
| #L13: |
| { |
| final synthesized self::Enum? #0#0 = e; |
| late final synthesized core::bool #0#8 = #0#0 == null; |
| if(#C3 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("a"); |
| break #L13; |
| } |
| } |
| else |
| if(#C6 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L13; |
| } |
| } |
| else |
| if(#C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("c"); |
| break #L13; |
| } |
| } |
| else |
| if(#0#8) { |
| { |
| core::print("null1"); |
| break #L13; |
| } |
| } |
| else |
| if(#0#8) { |
| { |
| core::print("null2"); |
| break #L13; |
| } |
| } |
| } |
| } |
| static method exhaustiveGenericSwitch(self::GenericEnum<dynamic> e) → void { |
| #L14: |
| { |
| final synthesized self::GenericEnum<dynamic> #0#0 = e; |
| if(#C11 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("a"); |
| break #L14; |
| } |
| } |
| else |
| if(#C12 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("b"); |
| break #L14; |
| } |
| } |
| else |
| if(#C13 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("c"); |
| break #L14; |
| } |
| } |
| } |
| } |
| static method exhaustiveGenericSwitchTyped(self::GenericEnum<core::int> e) → void { |
| #L15: |
| { |
| final synthesized self::GenericEnum<core::int> #0#0 = e; |
| if(#C11 =={core::Object::==}{(core::Object) → core::bool} #0#0) { |
| { |
| core::print("a"); |
| break #L15; |
| } |
| } |
| } |
| } |
| |
| constants { |
| #C1 = 0 |
| #C2 = "a" |
| #C3 = self::Enum {index:#C1, _name:#C2} |
| #C4 = 1 |
| #C5 = "b" |
| #C6 = self::Enum {index:#C4, _name:#C5} |
| #C7 = 2 |
| #C8 = "c" |
| #C9 = self::Enum {index:#C7, _name:#C8} |
| #C10 = <self::Enum*>[#C3, #C6, #C9] |
| #C11 = self::GenericEnum<core::int*> {index:#C1, _name:#C2} |
| #C12 = self::GenericEnum<core::String*> {index:#C4, _name:#C5} |
| #C13 = self::GenericEnum<core::bool*> {index:#C7, _name:#C8} |
| #C14 = <self::GenericEnum<dynamic>*>[#C11, #C12, #C13] |
| } |
| |
| |
| Constructor coverage from constants: |
| org-dartlang-testcase:///enum_switch.dart: |
| - Enum. (from org-dartlang-testcase:///enum_switch.dart:5:6) |
| - _Enum. (from org-dartlang-sdk:///sdk/lib/core/enum.dart) |
| - Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart) |
| - GenericEnum. (from org-dartlang-testcase:///enum_switch.dart:187:6) |