| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/patterns/exhaustiveness/record.dart:18:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'. |
| // Try adding a wildcard pattern or cases that match '(_, _, named: true)'. |
| // nonExhaustiveRestrictedValue1((int, String, {bool named}) r) => switch (r) { |
| // ^ |
| // |
| // pkg/front_end/testcases/patterns/exhaustiveness/record.dart:22:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: true)'. |
| // Try adding a wildcard pattern or cases that match '(_, _, named: true)'. |
| // nonExhaustiveRestrictedValue2((int, String, {bool named}) r) => switch (r) { |
| // ^ |
| // |
| // pkg/front_end/testcases/patterns/exhaustiveness/record.dart:26:73: Error: The type '(int, String, {bool named})' is not exhaustively matched by the switch cases since it doesn't match '(int(), String(), named: false)'. |
| // Try adding a wildcard pattern or cases that match '(_, _, named: false)'. |
| // nonExhaustiveRestrictedValue3((int, String, {bool named}) r) => switch (r) { |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| import "dart:_internal" as _in; |
| |
| static method exhaustiveWildcard((core::int, core::String, {required named: core::bool}) r) → dynamic |
| return block { |
| core::int #t1; |
| final synthesized(core::int, core::String, {required named: core::bool}) #0#0 = r; |
| #L1: |
| { |
| { |
| if(true) { |
| #t1 = 0; |
| break #L1; |
| } |
| } |
| throw{for-error-handling} new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); |
| } |
| } =>#t1; |
| static method exhaustiveTyped((core::int, core::String, {required named: core::bool}) r) → dynamic |
| return block { |
| core::int #t2; |
| final synthesized(core::int, core::String, {required named: core::bool}) #0#0 = r; |
| #L2: |
| { |
| { |
| if(true) { |
| #t2 = 0; |
| break #L2; |
| } |
| } |
| throw{for-error-handling} new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); |
| } |
| } =>#t2; |
| static method exhaustiveValue((core::int, core::String, {required named: core::bool}) r) → dynamic |
| return block { |
| core::int #t3; |
| final synthesized(core::int, core::String, {required named: core::bool}) #0#0 = r; |
| synthesized core::bool #0#3; |
| synthesized core::bool #0#3#isSet = false; |
| #L3: |
| { |
| { |
| if(#C1 =={core::Object::==}{(core::Object) → core::bool} (#0#3#isSet ?{core::bool} #0#3{core::bool} : let final core::bool #t4 = #0#3#isSet = true in #0#3 = #0#0.named{core::bool})) { |
| #t3 = 0; |
| break #L3; |
| } |
| } |
| { |
| if(#C2 =={core::Object::==}{(core::Object) → core::bool} (#0#3#isSet ?{core::bool} #0#3{core::bool} : let final core::bool #t5 = #0#3#isSet = true in #0#3 = #0#0.named{core::bool})) { |
| #t3 = 1; |
| break #L3; |
| } |
| } |
| throw{for-error-handling} new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); |
| } |
| } =>#t3; |
| static method nonExhaustiveRestrictedValue1((core::int, core::String, {required named: core::bool}) r) → dynamic |
| return block { |
| core::int #t6; |
| final synthesized(core::int, core::String, {required named: core::bool}) #0#0 = r; |
| #L4: |
| { |
| { |
| if(#C3 =={core::num::==}{(core::Object) → core::bool} #0#0.$1{core::int}) { |
| #t6 = 1; |
| break #L4; |
| } |
| } |
| throw{for-error-handling} new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); |
| } |
| } =>#t6; |
| static method nonExhaustiveRestrictedValue2((core::int, core::String, {required named: core::bool}) r) → dynamic |
| return block { |
| core::int #t7; |
| final synthesized(core::int, core::String, {required named: core::bool}) #0#0 = r; |
| #L5: |
| { |
| { |
| if(#C4 =={core::String::==}{(core::Object) → core::bool} #0#0.$2{core::String}) { |
| #t7 = 1; |
| break #L5; |
| } |
| } |
| throw{for-error-handling} new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); |
| } |
| } =>#t7; |
| static method nonExhaustiveRestrictedValue3((core::int, core::String, {required named: core::bool}) r) → dynamic |
| return block { |
| core::int #t8; |
| final synthesized(core::int, core::String, {required named: core::bool}) #0#0 = r; |
| #L6: |
| { |
| { |
| if(#C1 =={core::Object::==}{(core::Object) → core::bool} #0#0.named{core::bool}) { |
| #t8 = 1; |
| break #L6; |
| } |
| } |
| throw{for-error-handling} new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); |
| } |
| } =>#t8; |
| |
| constants { |
| #C1 = true |
| #C2 = false |
| #C3 = 5 |
| #C4 = "foo" |
| } |