be1a45173a
This ensures that the expression is constant evaluated which is need for exhaustiveness checking. Change-Id: I5ff2e1dd29a84e051254667537d8c9ec681930f6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279166 Reviewed-by: Jens Johansen <jensj@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
static method test(dynamic x) → dynamic {
|
|
#L1:
|
|
{
|
|
final dynamic #t1 = x;
|
|
core::int #t2 = -1;
|
|
core::bool #t3 = false;
|
|
if(!#t3) {
|
|
final dynamic #t4 = #t1;
|
|
if(#t4 is{ForNonNullableByDefault} core::Map<dynamic, dynamic> && (#t4{core::Map<dynamic, dynamic>}.{core::Map::containsKey}("a"){(core::Object?) → core::bool} && #t4{core::Map<dynamic, dynamic>}.{core::Map::containsKey}("b"){(core::Object?) → core::bool}) && #t4{core::Map<dynamic, dynamic>}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 2) {
|
|
final dynamic #t5 = #t4{core::Map<dynamic, dynamic>}.{core::Map::[]}("a"){(core::Object?) → dynamic};
|
|
final dynamic #t6 = #t4{core::Map<dynamic, dynamic>}.{core::Map::[]}("b"){(core::Object?) → dynamic};
|
|
if(#t5 =={core::Object::==}{(core::Object) → core::bool} #C1) {
|
|
if(#t6 =={core::Object::==}{(core::Object) → core::bool} #C2) {
|
|
#t2 = 0;
|
|
#t3 = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
switch(#t2) {
|
|
#L2:
|
|
case #C3:
|
|
{
|
|
{
|
|
break #L1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
constants {
|
|
#C1 = 1
|
|
#C2 = 2
|
|
#C3 = 0
|
|
}
|