diff --git a/pkg/front_end/lib/src/fasta/type_inference/inference_visitor.dart b/pkg/front_end/lib/src/fasta/type_inference/inference_visitor.dart index a1f27bcbdef..67247fd1483 100644 --- a/pkg/front_end/lib/src/fasta/type_inference/inference_visitor.dart +++ b/pkg/front_end/lib/src/fasta/type_inference/inference_visitor.dart @@ -10207,6 +10207,16 @@ class InferenceVisitorImpl extends InferenceVisitorBase node.lengthCheckTarget = greaterThanOrEqualTarget.member as Procedure; node.lengthCheckType = greaterThanOrEqualTarget.getFunctionType(this); + } else if (node.patterns.isEmpty) { + ObjectAccessTarget lessThanOrEqualsInvokeTarget = findInterfaceMember( + lengthType, lessThanOrEqualsName, node.fileOffset, + includeExtensionMethods: true, + callSiteAccessKind: CallSiteAccessKind.operatorInvocation); + assert(lessThanOrEqualsInvokeTarget.isInstanceMember || + lessThanOrEqualsInvokeTarget.isObjectMember); + + node.lengthCheckTarget = lessThanOrEqualsInvokeTarget.member as Procedure; + node.lengthCheckType = lessThanOrEqualsInvokeTarget.getFunctionType(this); } else { ObjectAccessTarget equalsInvokeTarget = findInterfaceMember( lengthType, equalsName, node.fileOffset, @@ -10607,16 +10617,26 @@ class InferenceVisitorImpl extends InferenceVisitorBase node.lengthCheckTarget = greaterThanOrEqualTarget.member as Procedure; node.lengthCheckType = greaterThanOrEqualTarget.getFunctionType(this); + } else if (node.entries.isEmpty) { + ObjectAccessTarget lessThanOrEqualInvokeTarget = findInterfaceMember( + lengthType, lessThanOrEqualsName, node.fileOffset, + includeExtensionMethods: true, + callSiteAccessKind: CallSiteAccessKind.operatorInvocation); + assert(lessThanOrEqualInvokeTarget.isInstanceMember || + lessThanOrEqualInvokeTarget.isObjectMember); + + node.lengthCheckTarget = lessThanOrEqualInvokeTarget.member as Procedure; + node.lengthCheckType = lessThanOrEqualInvokeTarget.getFunctionType(this); } else { - ObjectAccessTarget equalsInvokeTarget = findInterfaceMember( + ObjectAccessTarget equalInvokeTarget = findInterfaceMember( lengthType, equalsName, node.fileOffset, includeExtensionMethods: true, callSiteAccessKind: CallSiteAccessKind.operatorInvocation); - assert(equalsInvokeTarget.isInstanceMember || - equalsInvokeTarget.isObjectMember); + assert(equalInvokeTarget.isInstanceMember || + equalInvokeTarget.isObjectMember); - node.lengthCheckTarget = equalsInvokeTarget.member as Procedure; - node.lengthCheckType = equalsInvokeTarget.getFunctionType(this); + node.lengthCheckTarget = equalInvokeTarget.member as Procedure; + node.lengthCheckType = equalInvokeTarget.getFunctionType(this); } ObjectAccessTarget containsKeyTarget = findInterfaceMember( diff --git a/pkg/front_end/lib/src/fasta/type_inference/matching_expressions.dart b/pkg/front_end/lib/src/fasta/type_inference/matching_expressions.dart index e9895924b9f..80cce0fc3a9 100644 --- a/pkg/front_end/lib/src/fasta/type_inference/matching_expressions.dart +++ b/pkg/front_end/lib/src/fasta/type_inference/matching_expressions.dart @@ -128,16 +128,28 @@ class MatchingExpressionVisitor fileOffset: node.fileOffset); } } else { - CacheableExpression constExpression = matchingCache - .createIntConstant(node.patterns.length, fileOffset: node.fileOffset); + int length = node.patterns.length; + CacheableExpression constExpression = + matchingCache.createIntConstant(length, fileOffset: node.fileOffset); - lengthCheck = matchingCache.createEqualsExpression( - lengthGet, - constExpression, - new DelayedEqualsExpression(lengthGet, constExpression, - node.lengthCheckTarget, node.lengthCheckType!, - fileOffset: node.fileOffset), - fileOffset: node.fileOffset); + if (length == 0) { + lengthCheck = matchingCache.createComparisonExpression( + lengthGet, + lessThanOrEqualsName.text, + constExpression, + new DelayedInstanceInvocation(lengthGet, node.lengthCheckTarget, + node.lengthCheckType!, [constExpression], + fileOffset: node.fileOffset), + fileOffset: node.fileOffset); + } else { + lengthCheck = matchingCache.createEqualsExpression( + lengthGet, + constExpression, + new DelayedEqualsExpression(lengthGet, constExpression, + node.lengthCheckTarget, node.lengthCheckType!, + fileOffset: node.fileOffset), + fileOffset: node.fileOffset); + } } DelayedExpression? matchingExpression; @@ -288,16 +300,27 @@ class MatchingExpressionVisitor fileOffset: node.fileOffset); } } else { - CacheableExpression constExpression = matchingCache - .createIntConstant(node.entries.length, fileOffset: node.fileOffset); - - lengthCheck = matchingCache.createEqualsExpression( - lengthGet, - constExpression, - new DelayedEqualsExpression(lengthGet, constExpression, - node.lengthCheckTarget, node.lengthCheckType!, - fileOffset: node.fileOffset), - fileOffset: node.fileOffset); + int length = node.entries.length; + CacheableExpression constExpression = + matchingCache.createIntConstant(length, fileOffset: node.fileOffset); + if (length == 0) { + lengthCheck = matchingCache.createComparisonExpression( + lengthGet, + lessThanOrEqualsName.text, + constExpression, + new DelayedInstanceInvocation(lengthGet, node.lengthCheckTarget, + node.lengthCheckType!, [constExpression], + fileOffset: node.fileOffset), + fileOffset: node.fileOffset); + } else { + lengthCheck = matchingCache.createEqualsExpression( + lengthGet, + constExpression, + new DelayedEqualsExpression(lengthGet, constExpression, + node.lengthCheckTarget, node.lengthCheckType!, + fileOffset: node.fileOffset), + fileOffset: node.fileOffset); + } } DelayedExpression? matchingExpression; diff --git a/pkg/front_end/testcases/late_lowering/caching.dart.strong.expect b/pkg/front_end/testcases/late_lowering/caching.dart.strong.expect index 59f92d99f55..af02164d833 100644 --- a/pkg/front_end/testcases/late_lowering/caching.dart.strong.expect +++ b/pkg/front_end/testcases/late_lowering/caching.dart.strong.expect @@ -175,7 +175,7 @@ static method ifCase(dynamic o) → core::int { } { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } } @@ -375,7 +375,7 @@ static method ifCaseElse(dynamic o) → core::int { } else { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } else { @@ -667,7 +667,7 @@ static method switchStatement(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t81 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t81 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { { return 21; } @@ -931,7 +931,7 @@ static method switchExpression(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t130 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t130 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { #t95 = 21; break #L2; } diff --git a/pkg/front_end/testcases/late_lowering/caching.dart.strong.transformed.expect b/pkg/front_end/testcases/late_lowering/caching.dart.strong.transformed.expect index 077f72a3096..abad3c25c2a 100644 --- a/pkg/front_end/testcases/late_lowering/caching.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/late_lowering/caching.dart.strong.transformed.expect @@ -175,7 +175,7 @@ static method ifCase(dynamic o) → core::int { } { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } } @@ -375,7 +375,7 @@ static method ifCaseElse(dynamic o) → core::int { } else { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } else { @@ -667,7 +667,7 @@ static method switchStatement(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t84 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t84 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { { return 21; } @@ -931,7 +931,7 @@ static method switchExpression(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t134 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t134 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { #t98 = 21; break #L2; } diff --git a/pkg/front_end/testcases/late_lowering/caching.dart.weak.expect b/pkg/front_end/testcases/late_lowering/caching.dart.weak.expect index acdad41ed72..385dd50b836 100644 --- a/pkg/front_end/testcases/late_lowering/caching.dart.weak.expect +++ b/pkg/front_end/testcases/late_lowering/caching.dart.weak.expect @@ -176,7 +176,7 @@ static method ifCase(dynamic o) → core::int { } { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } } @@ -376,7 +376,7 @@ static method ifCaseElse(dynamic o) → core::int { } else { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } else { @@ -668,7 +668,7 @@ static method switchStatement(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t81 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t81 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { { return 21; } @@ -932,7 +932,7 @@ static method switchExpression(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t130 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t130 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { #t95 = 21; break #L2; } diff --git a/pkg/front_end/testcases/late_lowering/caching.dart.weak.modular.expect b/pkg/front_end/testcases/late_lowering/caching.dart.weak.modular.expect index acdad41ed72..385dd50b836 100644 --- a/pkg/front_end/testcases/late_lowering/caching.dart.weak.modular.expect +++ b/pkg/front_end/testcases/late_lowering/caching.dart.weak.modular.expect @@ -176,7 +176,7 @@ static method ifCase(dynamic o) → core::int { } { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } } @@ -376,7 +376,7 @@ static method ifCaseElse(dynamic o) → core::int { } else { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } else { @@ -668,7 +668,7 @@ static method switchStatement(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t81 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t81 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { { return 21; } @@ -932,7 +932,7 @@ static method switchExpression(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t130 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t130 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { #t95 = 21; break #L2; } diff --git a/pkg/front_end/testcases/late_lowering/caching.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/caching.dart.weak.transformed.expect index 72a61ee827e..6d52be29dcb 100644 --- a/pkg/front_end/testcases/late_lowering/caching.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/late_lowering/caching.dart.weak.transformed.expect @@ -176,7 +176,7 @@ static method ifCase(dynamic o) → core::int { } { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } } @@ -376,7 +376,7 @@ static method ifCaseElse(dynamic o) → core::int { } else { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } else { @@ -668,7 +668,7 @@ static method switchStatement(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t81 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t81 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { { return 21; } @@ -932,7 +932,7 @@ static method switchExpression(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t130 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t130 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { #t95 = 21; break #L2; } diff --git a/pkg/front_end/testcases/patterns/caching.dart.strong.expect b/pkg/front_end/testcases/patterns/caching.dart.strong.expect index 3daac6d72cc..7088f69592b 100644 --- a/pkg/front_end/testcases/patterns/caching.dart.strong.expect +++ b/pkg/front_end/testcases/patterns/caching.dart.strong.expect @@ -145,7 +145,7 @@ static method ifCase(dynamic o) → core::int { } { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } } @@ -312,7 +312,7 @@ static method ifCaseElse(dynamic o) → core::int { } else { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } else { @@ -556,7 +556,7 @@ static method switchStatement(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t44 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t44 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { { return 21; } @@ -775,7 +775,7 @@ static method switchExpression(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t78 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t78 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { #t58 = 21; break #L2; } diff --git a/pkg/front_end/testcases/patterns/caching.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/caching.dart.strong.transformed.expect index d197d9738a7..a793d4e2263 100644 --- a/pkg/front_end/testcases/patterns/caching.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/patterns/caching.dart.strong.transformed.expect @@ -165,7 +165,7 @@ static method ifCase(dynamic o) → core::int { } { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } } @@ -354,7 +354,7 @@ static method ifCaseElse(dynamic o) → core::int { } else { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } else { @@ -630,7 +630,7 @@ static method switchStatement(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t47 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t47 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { { return 21; } @@ -879,7 +879,7 @@ static method switchExpression(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t82 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t82 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { #t61 = 21; break #L2; } diff --git a/pkg/front_end/testcases/patterns/caching.dart.weak.expect b/pkg/front_end/testcases/patterns/caching.dart.weak.expect index defdaa4ffc3..352c39f76e2 100644 --- a/pkg/front_end/testcases/patterns/caching.dart.weak.expect +++ b/pkg/front_end/testcases/patterns/caching.dart.weak.expect @@ -146,7 +146,7 @@ static method ifCase(dynamic o) → core::int { } { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } } @@ -313,7 +313,7 @@ static method ifCaseElse(dynamic o) → core::int { } else { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } else { @@ -557,7 +557,7 @@ static method switchStatement(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t44 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t44 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { { return 21; } @@ -776,7 +776,7 @@ static method switchExpression(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t78 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t78 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { #t58 = 21; break #L2; } diff --git a/pkg/front_end/testcases/patterns/caching.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/caching.dart.weak.modular.expect index defdaa4ffc3..352c39f76e2 100644 --- a/pkg/front_end/testcases/patterns/caching.dart.weak.modular.expect +++ b/pkg/front_end/testcases/patterns/caching.dart.weak.modular.expect @@ -146,7 +146,7 @@ static method ifCase(dynamic o) → core::int { } { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } } @@ -313,7 +313,7 @@ static method ifCaseElse(dynamic o) → core::int { } else { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } else { @@ -557,7 +557,7 @@ static method switchStatement(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t44 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t44 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { { return 21; } @@ -776,7 +776,7 @@ static method switchExpression(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t78 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final dynamic #t78 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { #t58 = 21; break #L2; } diff --git a/pkg/front_end/testcases/patterns/caching.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/caching.dart.weak.transformed.expect index 3c94e357b56..75d2d118ede 100644 --- a/pkg/front_end/testcases/patterns/caching.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/patterns/caching.dart.weak.transformed.expect @@ -166,7 +166,7 @@ static method ifCase(dynamic o) → core::int { } { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } } @@ -355,7 +355,7 @@ static method ifCaseElse(dynamic o) → core::int { } else { final synthesized dynamic #20#0 = o; - if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#20#0 is{ForNonNullableByDefault} core::Map && #20#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C12){(core::num) → core::bool}) { return 21; } else { @@ -631,7 +631,7 @@ static method switchStatement(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t44 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t44 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { { return 21; } @@ -880,7 +880,7 @@ static method switchExpression(dynamic o) → core::int { } } { - if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t78 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C12) { + if(#0#0 is{ForNonNullableByDefault} core::Map && (#0#26#isSet ?{core::int} #0#26{core::int} : let final core::bool* #t78 = #0#26#isSet = true in #0#26 = #0#0{core::Map}.{core::Map::length}{core::int}).{core::num::<=}(#C12){(core::num) → core::bool}) { #t58 = 21; break #L2; } diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.expect b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.expect index 2354b328576..3e2b42a3c86 100644 --- a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.expect +++ b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.expect @@ -123,7 +123,7 @@ static method exhaustive1a(core::List list) → dynamic #L2: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t2 = 0; break #L2; } @@ -144,7 +144,7 @@ static method exhaustive1b(core::List list) → dynamic #L3: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t3 = 0; break #L3; } @@ -165,7 +165,7 @@ static method exhaustive2a(core::List list) → dynamic #L4: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t4 = 0; break #L4; } @@ -192,7 +192,7 @@ static method exhaustive2b(core::List list) → dynamic #L5: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t5 = 0; break #L5; } @@ -219,7 +219,7 @@ static method exhaustive2c(core::List list) → dynamic #L6: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t6 = 0; break #L6; } @@ -274,7 +274,7 @@ static method nonExhaustive2aMissing(core::List list) → dynamic #L9: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t9 = 0; break #L9; } @@ -295,7 +295,7 @@ static method nonExhaustive2bMissing(core::List list) → dynamic #L10: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t10 = 0; break #L10; } @@ -316,7 +316,7 @@ static method nonExhaustive2cMissing(core::List list) → dynamic #L11: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t11 = 0; break #L11; } @@ -351,7 +351,7 @@ static method nonExhaustive1aRestrictedValue(core::List list) → dyn #L13: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t13 = 0; break #L13; } @@ -373,7 +373,7 @@ static method nonExhaustive1aRestrictedType(core::List list) → dyna #L14: { { - if(#0#0 is{ForNonNullableByDefault} core::List && (#0#2#isSet ?{core::int} #0#2{core::int} : let final dynamic #t15 = #0#2#isSet = true in #0#2 = #0#0{core::List}.{core::List::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && (#0#2#isSet ?{core::int} #0#2{core::int} : let final dynamic #t15 = #0#2#isSet = true in #0#2 = #0#0{core::List}.{core::List::length}{core::int}).{core::num::<=}(#C1){(core::num) → core::bool}) { #t14 = 0; break #L14; } @@ -394,7 +394,7 @@ static method nonExhaustive1bRestrictedValue(core::List list) → dyn #L15: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t17 = 0; break #L15; } @@ -415,7 +415,7 @@ static method nonExhaustive1bRestrictedType(core::List list) → dyna #L16: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t18 = 0; break #L16; } @@ -436,7 +436,7 @@ static method nonExhaustive2aRestrictedValue(core::List list) → dyn #L17: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t19 = 0; break #L17; } @@ -463,7 +463,7 @@ static method nonExhaustive2bRestrictedValue(core::List list) → dyn #L18: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t20 = 0; break #L18; } @@ -490,7 +490,7 @@ static method nonExhaustive2cRestrictedValue(core::List list) → dyn #L19: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t21 = 0; break #L19; } @@ -517,7 +517,7 @@ static method nonExhaustive2dRestrictedValue(core::List list) → dyn #L20: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t22 = 0; break #L20; } @@ -544,7 +544,7 @@ static method nonExhaustive2eRestrictedValue(core::List list) → dyn #L21: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t23 = 0; break #L21; } @@ -571,7 +571,7 @@ static method nonExhaustive2fRestrictedValue(core::List list) → dyn #L22: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t24 = 0; break #L22; } diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.transformed.expect index 432607b2780..f4e8e83a8fd 100644 --- a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.strong.transformed.expect @@ -125,7 +125,7 @@ static method exhaustive1a(core::List list) → dynamic #L2: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t2 = 0; break #L2; } @@ -148,7 +148,7 @@ static method exhaustive1b(core::List list) → dynamic #L3: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t3 = 0; break #L3; } @@ -171,7 +171,7 @@ static method exhaustive2a(core::List list) → dynamic #L4: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t4 = 0; break #L4; } @@ -200,7 +200,7 @@ static method exhaustive2b(core::List list) → dynamic #L5: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t5 = 0; break #L5; } @@ -229,7 +229,7 @@ static method exhaustive2c(core::List list) → dynamic #L6: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t6 = 0; break #L6; } @@ -286,7 +286,7 @@ static method nonExhaustive2aMissing(core::List list) → dynamic #L9: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t9 = 0; break #L9; } @@ -309,7 +309,7 @@ static method nonExhaustive2bMissing(core::List list) → dynamic #L10: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t10 = 0; break #L10; } @@ -332,7 +332,7 @@ static method nonExhaustive2cMissing(core::List list) → dynamic #L11: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t11 = 0; break #L11; } @@ -369,7 +369,7 @@ static method nonExhaustive1aRestrictedValue(core::List list) → dyn #L13: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t13 = 0; break #L13; } @@ -391,7 +391,7 @@ static method nonExhaustive1aRestrictedType(core::List list) → dyna #L14: { { - if(#0#0 is{ForNonNullableByDefault} core::List && (#0#2#isSet ?{core::int} #0#2{core::int} : let final core::bool* #t15 = #0#2#isSet = true in #0#2 = #0#0{core::List}.{core::List::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && (#0#2#isSet ?{core::int} #0#2{core::int} : let final core::bool* #t15 = #0#2#isSet = true in #0#2 = #0#0{core::List}.{core::List::length}{core::int}).{core::num::<=}(#C1){(core::num) → core::bool}) { #t14 = 0; break #L14; } @@ -414,7 +414,7 @@ static method nonExhaustive1bRestrictedValue(core::List list) → dyn #L15: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t17 = 0; break #L15; } @@ -437,7 +437,7 @@ static method nonExhaustive1bRestrictedType(core::List list) → dyna #L16: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t18 = 0; break #L16; } @@ -460,7 +460,7 @@ static method nonExhaustive2aRestrictedValue(core::List list) → dyn #L17: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t19 = 0; break #L17; } @@ -489,7 +489,7 @@ static method nonExhaustive2bRestrictedValue(core::List list) → dyn #L18: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t20 = 0; break #L18; } @@ -518,7 +518,7 @@ static method nonExhaustive2cRestrictedValue(core::List list) → dyn #L19: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t21 = 0; break #L19; } @@ -547,7 +547,7 @@ static method nonExhaustive2dRestrictedValue(core::List list) → dyn #L20: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t22 = 0; break #L20; } @@ -576,7 +576,7 @@ static method nonExhaustive2eRestrictedValue(core::List list) → dyn #L21: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t23 = 0; break #L21; } @@ -605,7 +605,7 @@ static method nonExhaustive2fRestrictedValue(core::List list) → dyn #L22: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t24 = 0; break #L22; } diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.expect b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.expect index e5d0b9b377c..7c9519a6cc3 100644 --- a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.expect +++ b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.expect @@ -125,7 +125,7 @@ static method exhaustive1a(core::List list) → dynamic #L2: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t2 = 0; break #L2; } @@ -147,7 +147,7 @@ static method exhaustive1b(core::List list) → dynamic #L3: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t3 = 0; break #L3; } @@ -169,7 +169,7 @@ static method exhaustive2a(core::List list) → dynamic #L4: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t4 = 0; break #L4; } @@ -197,7 +197,7 @@ static method exhaustive2b(core::List list) → dynamic #L5: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t5 = 0; break #L5; } @@ -225,7 +225,7 @@ static method exhaustive2c(core::List list) → dynamic #L6: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t6 = 0; break #L6; } @@ -283,7 +283,7 @@ static method nonExhaustive2aMissing(core::List list) → dynamic #L9: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t9 = 0; break #L9; } @@ -305,7 +305,7 @@ static method nonExhaustive2bMissing(core::List list) → dynamic #L10: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t10 = 0; break #L10; } @@ -327,7 +327,7 @@ static method nonExhaustive2cMissing(core::List list) → dynamic #L11: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t11 = 0; break #L11; } @@ -364,7 +364,7 @@ static method nonExhaustive1aRestrictedValue(core::List list) → dyn #L13: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t13 = 0; break #L13; } @@ -387,7 +387,7 @@ static method nonExhaustive1aRestrictedType(core::List list) → dyna #L14: { { - if(#0#0 is{ForNonNullableByDefault} core::List && (#0#2#isSet ?{core::int} #0#2{core::int} : let final dynamic #t15 = #0#2#isSet = true in #0#2 = #0#0{core::List}.{core::List::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && (#0#2#isSet ?{core::int} #0#2{core::int} : let final dynamic #t15 = #0#2#isSet = true in #0#2 = #0#0{core::List}.{core::List::length}{core::int}).{core::num::<=}(#C1){(core::num) → core::bool}) { #t14 = 0; break #L14; } @@ -409,7 +409,7 @@ static method nonExhaustive1bRestrictedValue(core::List list) → dyn #L15: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t17 = 0; break #L15; } @@ -431,7 +431,7 @@ static method nonExhaustive1bRestrictedType(core::List list) → dyna #L16: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t18 = 0; break #L16; } @@ -453,7 +453,7 @@ static method nonExhaustive2aRestrictedValue(core::List list) → dyn #L17: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t19 = 0; break #L17; } @@ -481,7 +481,7 @@ static method nonExhaustive2bRestrictedValue(core::List list) → dyn #L18: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t20 = 0; break #L18; } @@ -509,7 +509,7 @@ static method nonExhaustive2cRestrictedValue(core::List list) → dyn #L19: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t21 = 0; break #L19; } @@ -537,7 +537,7 @@ static method nonExhaustive2dRestrictedValue(core::List list) → dyn #L20: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t22 = 0; break #L20; } @@ -565,7 +565,7 @@ static method nonExhaustive2eRestrictedValue(core::List list) → dyn #L21: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t23 = 0; break #L21; } @@ -593,7 +593,7 @@ static method nonExhaustive2fRestrictedValue(core::List list) → dyn #L22: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t24 = 0; break #L22; } diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.modular.expect index e5d0b9b377c..7c9519a6cc3 100644 --- a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.modular.expect +++ b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.modular.expect @@ -125,7 +125,7 @@ static method exhaustive1a(core::List list) → dynamic #L2: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t2 = 0; break #L2; } @@ -147,7 +147,7 @@ static method exhaustive1b(core::List list) → dynamic #L3: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t3 = 0; break #L3; } @@ -169,7 +169,7 @@ static method exhaustive2a(core::List list) → dynamic #L4: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t4 = 0; break #L4; } @@ -197,7 +197,7 @@ static method exhaustive2b(core::List list) → dynamic #L5: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t5 = 0; break #L5; } @@ -225,7 +225,7 @@ static method exhaustive2c(core::List list) → dynamic #L6: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t6 = 0; break #L6; } @@ -283,7 +283,7 @@ static method nonExhaustive2aMissing(core::List list) → dynamic #L9: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t9 = 0; break #L9; } @@ -305,7 +305,7 @@ static method nonExhaustive2bMissing(core::List list) → dynamic #L10: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t10 = 0; break #L10; } @@ -327,7 +327,7 @@ static method nonExhaustive2cMissing(core::List list) → dynamic #L11: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t11 = 0; break #L11; } @@ -364,7 +364,7 @@ static method nonExhaustive1aRestrictedValue(core::List list) → dyn #L13: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t13 = 0; break #L13; } @@ -387,7 +387,7 @@ static method nonExhaustive1aRestrictedType(core::List list) → dyna #L14: { { - if(#0#0 is{ForNonNullableByDefault} core::List && (#0#2#isSet ?{core::int} #0#2{core::int} : let final dynamic #t15 = #0#2#isSet = true in #0#2 = #0#0{core::List}.{core::List::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && (#0#2#isSet ?{core::int} #0#2{core::int} : let final dynamic #t15 = #0#2#isSet = true in #0#2 = #0#0{core::List}.{core::List::length}{core::int}).{core::num::<=}(#C1){(core::num) → core::bool}) { #t14 = 0; break #L14; } @@ -409,7 +409,7 @@ static method nonExhaustive1bRestrictedValue(core::List list) → dyn #L15: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t17 = 0; break #L15; } @@ -431,7 +431,7 @@ static method nonExhaustive1bRestrictedType(core::List list) → dyna #L16: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t18 = 0; break #L16; } @@ -453,7 +453,7 @@ static method nonExhaustive2aRestrictedValue(core::List list) → dyn #L17: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t19 = 0; break #L17; } @@ -481,7 +481,7 @@ static method nonExhaustive2bRestrictedValue(core::List list) → dyn #L18: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t20 = 0; break #L18; } @@ -509,7 +509,7 @@ static method nonExhaustive2cRestrictedValue(core::List list) → dyn #L19: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t21 = 0; break #L19; } @@ -537,7 +537,7 @@ static method nonExhaustive2dRestrictedValue(core::List list) → dyn #L20: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t22 = 0; break #L20; } @@ -565,7 +565,7 @@ static method nonExhaustive2eRestrictedValue(core::List list) → dyn #L21: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t23 = 0; break #L21; } @@ -593,7 +593,7 @@ static method nonExhaustive2fRestrictedValue(core::List list) → dyn #L22: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t24 = 0; break #L22; } diff --git a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.transformed.expect index 520a09e8890..c252a6fe527 100644 --- a/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/patterns/exhaustiveness/list.dart.weak.transformed.expect @@ -127,7 +127,7 @@ static method exhaustive1a(core::List list) → dynamic #L2: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t2 = 0; break #L2; } @@ -151,7 +151,7 @@ static method exhaustive1b(core::List list) → dynamic #L3: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t3 = 0; break #L3; } @@ -175,7 +175,7 @@ static method exhaustive2a(core::List list) → dynamic #L4: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t4 = 0; break #L4; } @@ -205,7 +205,7 @@ static method exhaustive2b(core::List list) → dynamic #L5: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t5 = 0; break #L5; } @@ -235,7 +235,7 @@ static method exhaustive2c(core::List list) → dynamic #L6: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t6 = 0; break #L6; } @@ -295,7 +295,7 @@ static method nonExhaustive2aMissing(core::List list) → dynamic #L9: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t9 = 0; break #L9; } @@ -319,7 +319,7 @@ static method nonExhaustive2bMissing(core::List list) → dynamic #L10: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t10 = 0; break #L10; } @@ -343,7 +343,7 @@ static method nonExhaustive2cMissing(core::List list) → dynamic #L11: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t11 = 0; break #L11; } @@ -382,7 +382,7 @@ static method nonExhaustive1aRestrictedValue(core::List list) → dyn #L13: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t13 = 0; break #L13; } @@ -405,7 +405,7 @@ static method nonExhaustive1aRestrictedType(core::List list) → dyna #L14: { { - if(#0#0 is{ForNonNullableByDefault} core::List && (#0#2#isSet ?{core::int} #0#2{core::int} : let final core::bool* #t15 = #0#2#isSet = true in #0#2 = #0#0{core::List}.{core::List::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && (#0#2#isSet ?{core::int} #0#2{core::int} : let final core::bool* #t15 = #0#2#isSet = true in #0#2 = #0#0{core::List}.{core::List::length}{core::int}).{core::num::<=}(#C1){(core::num) → core::bool}) { #t14 = 0; break #L14; } @@ -429,7 +429,7 @@ static method nonExhaustive1bRestrictedValue(core::List list) → dyn #L15: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t17 = 0; break #L15; } @@ -453,7 +453,7 @@ static method nonExhaustive1bRestrictedType(core::List list) → dyna #L16: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t18 = 0; break #L16; } @@ -477,7 +477,7 @@ static method nonExhaustive2aRestrictedValue(core::List list) → dyn #L17: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t19 = 0; break #L17; } @@ -507,7 +507,7 @@ static method nonExhaustive2bRestrictedValue(core::List list) → dyn #L18: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t20 = 0; break #L18; } @@ -537,7 +537,7 @@ static method nonExhaustive2cRestrictedValue(core::List list) → dyn #L19: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t21 = 0; break #L19; } @@ -567,7 +567,7 @@ static method nonExhaustive2dRestrictedValue(core::List list) → dyn #L20: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t22 = 0; break #L20; } @@ -597,7 +597,7 @@ static method nonExhaustive2eRestrictedValue(core::List list) → dyn #L21: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t23 = 0; break #L21; } @@ -627,7 +627,7 @@ static method nonExhaustive2fRestrictedValue(core::List list) → dyn #L22: { { - if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#1.{core::num::<=}(#C1){(core::num) → core::bool}) { #t24 = 0; break #L22; } diff --git a/pkg/front_end/testcases/patterns/list_pattern_errors.dart.strong.expect b/pkg/front_end/testcases/patterns/list_pattern_errors.dart.strong.expect index e065749c4c3..25f17c72074 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_errors.dart.strong.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_errors.dart.strong.expect @@ -14,7 +14,7 @@ static method test(dynamic o) → dynamic { { final synthesized dynamic #0#0 = o; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { } } } diff --git a/pkg/front_end/testcases/patterns/list_pattern_errors.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/list_pattern_errors.dart.strong.transformed.expect index e065749c4c3..25f17c72074 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_errors.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_errors.dart.strong.transformed.expect @@ -14,7 +14,7 @@ static method test(dynamic o) → dynamic { { final synthesized dynamic #0#0 = o; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { } } } diff --git a/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.expect b/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.expect index e065749c4c3..25f17c72074 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.expect @@ -14,7 +14,7 @@ static method test(dynamic o) → dynamic { { final synthesized dynamic #0#0 = o; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { } } } diff --git a/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.modular.expect index e065749c4c3..25f17c72074 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.modular.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.modular.expect @@ -14,7 +14,7 @@ static method test(dynamic o) → dynamic { { final synthesized dynamic #0#0 = o; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { } } } diff --git a/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.transformed.expect index e065749c4c3..25f17c72074 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_errors.dart.weak.transformed.expect @@ -14,7 +14,7 @@ static method test(dynamic o) → dynamic { { final synthesized dynamic #0#0 = o; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { } } } diff --git a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.strong.expect b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.strong.expect index 30b4b650d56..be6e8961738 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.strong.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.strong.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.strong.transformed.expect index 30b4b650d56..be6e8961738 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.strong.transformed.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.expect b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.expect index 30b4b650d56..be6e8961738 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.modular.expect index 30b4b650d56..be6e8961738 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.modular.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.modular.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.transformed.expect index 30b4b650d56..be6e8961738 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty.dart.weak.transformed.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.strong.expect b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.strong.expect index 30b4b650d56..be6e8961738 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.strong.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.strong.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.strong.transformed.expect index 30b4b650d56..be6e8961738 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.strong.transformed.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.expect b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.expect index 30b4b650d56..be6e8961738 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.modular.expect index 30b4b650d56..be6e8961738 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.modular.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.modular.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.transformed.expect index 30b4b650d56..be6e8961738 100644 --- a/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.weak.transformed.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::List && #0#0{core::List}.{core::List::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/map_pattern_errors.dart.strong.expect b/pkg/front_end/testcases/patterns/map_pattern_errors.dart.strong.expect index 13259972d69..78c54e8395e 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_errors.dart.strong.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_errors.dart.strong.expect @@ -17,7 +17,7 @@ static method test(dynamic o) → dynamic { #L1: { final synthesized dynamic #0#0 = o; - late final synthesized core::bool #0#4 = #0#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1; + late final synthesized core::bool #0#4 = #0#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}; { if(#0#0 is{ForNonNullableByDefault} core::Map && #0#4 || #0#0 is{ForNonNullableByDefault} core::Map && #0#4) { } diff --git a/pkg/front_end/testcases/patterns/map_pattern_errors.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/map_pattern_errors.dart.strong.transformed.expect index 7d3294f5173..74846fc0084 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_errors.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_errors.dart.strong.transformed.expect @@ -18,7 +18,7 @@ static method test(dynamic o) → dynamic { { final synthesized dynamic #0#0 = o; function ##0#4#initializer() → core::bool - return #0#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1; + return #0#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}; late final synthesized core::bool #0#4 = ##0#4#initializer(){() → core::bool}; { if(#0#0 is{ForNonNullableByDefault} core::Map && #0#4 || #0#0 is{ForNonNullableByDefault} core::Map && #0#4) { diff --git a/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.expect b/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.expect index 13259972d69..78c54e8395e 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.expect @@ -17,7 +17,7 @@ static method test(dynamic o) → dynamic { #L1: { final synthesized dynamic #0#0 = o; - late final synthesized core::bool #0#4 = #0#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1; + late final synthesized core::bool #0#4 = #0#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}; { if(#0#0 is{ForNonNullableByDefault} core::Map && #0#4 || #0#0 is{ForNonNullableByDefault} core::Map && #0#4) { } diff --git a/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.modular.expect index 13259972d69..78c54e8395e 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.modular.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.modular.expect @@ -17,7 +17,7 @@ static method test(dynamic o) → dynamic { #L1: { final synthesized dynamic #0#0 = o; - late final synthesized core::bool #0#4 = #0#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1; + late final synthesized core::bool #0#4 = #0#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}; { if(#0#0 is{ForNonNullableByDefault} core::Map && #0#4 || #0#0 is{ForNonNullableByDefault} core::Map && #0#4) { } diff --git a/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.transformed.expect index 7d3294f5173..74846fc0084 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_errors.dart.weak.transformed.expect @@ -18,7 +18,7 @@ static method test(dynamic o) → dynamic { { final synthesized dynamic #0#0 = o; function ##0#4#initializer() → core::bool - return #0#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1; + return #0#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}; late final synthesized core::bool #0#4 = ##0#4#initializer(){() → core::bool}; { if(#0#0 is{ForNonNullableByDefault} core::Map && #0#4 || #0#0 is{ForNonNullableByDefault} core::Map && #0#4) { diff --git a/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.strong.expect b/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.strong.expect index f021ad84c24..97d32bc7832 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.strong.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.strong.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::Map && #0#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::Map && #0#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.strong.transformed.expect index f021ad84c24..97d32bc7832 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.strong.transformed.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::Map && #0#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::Map && #0#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.expect b/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.expect index f021ad84c24..97d32bc7832 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::Map && #0#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::Map && #0#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.modular.expect index f021ad84c24..97d32bc7832 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.modular.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.modular.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::Map && #0#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::Map && #0#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.transformed.expect index f021ad84c24..97d32bc7832 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_inside_case_empty.dart.weak.transformed.expect @@ -7,7 +7,7 @@ static method test(dynamic x) → dynamic { { final synthesized dynamic #0#0 = x; { - if(#0#0 is{ForNonNullableByDefault} core::Map && #0#0{core::Map}.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) { + if(#0#0 is{ForNonNullableByDefault} core::Map && #0#0{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(#C1){(core::num) → core::bool}) { { break #L1; } diff --git a/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.strong.expect b/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.strong.expect index d976a00122a..57002f5722d 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.strong.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.strong.expect @@ -33,7 +33,7 @@ static method test3(core::Map x) → dynamic { } { final synthesized core::Map #1#0 = x; - if(#1#0.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C9) { + if(#1#0.{core::Map::length}{core::int}.{core::num::<=}(#C9){(core::num) → core::bool}) { } } } diff --git a/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.strong.transformed.expect index f5e6135f9cc..5264419dcec 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.strong.transformed.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.strong.transformed.expect @@ -33,7 +33,7 @@ static method test3(core::Map x) → dynamic { } { final synthesized core::Map #1#0 = x; - if(#1#0.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C9) { + if(#1#0.{core::Map::length}{core::int}.{core::num::<=}(#C9){(core::num) → core::bool}) { } } } diff --git a/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.expect b/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.expect index d976a00122a..57002f5722d 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.expect @@ -33,7 +33,7 @@ static method test3(core::Map x) → dynamic { } { final synthesized core::Map #1#0 = x; - if(#1#0.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C9) { + if(#1#0.{core::Map::length}{core::int}.{core::num::<=}(#C9){(core::num) → core::bool}) { } } } diff --git a/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.modular.expect index d976a00122a..57002f5722d 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.modular.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.modular.expect @@ -33,7 +33,7 @@ static method test3(core::Map x) → dynamic { } { final synthesized core::Map #1#0 = x; - if(#1#0.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C9) { + if(#1#0.{core::Map::length}{core::int}.{core::num::<=}(#C9){(core::num) → core::bool}) { } } } diff --git a/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.transformed.expect index f5e6135f9cc..5264419dcec 100644 --- a/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.transformed.expect +++ b/pkg/front_end/testcases/patterns/map_pattern_inside_if_case.dart.weak.transformed.expect @@ -33,7 +33,7 @@ static method test3(core::Map x) → dynamic { } { final synthesized core::Map #1#0 = x; - if(#1#0.{core::Map::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C9) { + if(#1#0.{core::Map::length}{core::int}.{core::num::<=}(#C9){(core::num) → core::bool}) { } } } diff --git a/pkg/front_end/testcases/patterns/negative_length.dart b/pkg/front_end/testcases/patterns/negative_length.dart new file mode 100644 index 00000000000..8b011cc22f4 --- /dev/null +++ b/pkg/front_end/testcases/patterns/negative_length.dart @@ -0,0 +1,75 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:collection'; + +class NegativeLengthList with ListMixin { + final List _list; + + NegativeLengthList(this._list); + + int get length => _list.length <= 0 ? -1 : _list.length; + + void set length(int value) { + _list.length = value; + } + + E operator [](int index) => _list[index]; + + void operator []=(int index, E value) { + _list[index] = value; + } +} + +class NegativeLengthMap with MapMixin { + final Map _map; + + NegativeLengthMap(this._map); + + int get length => _map.length <= 0 ? -1 : _map.length; + + V? operator [](Object? key) => _map[key]; + + void operator []=(K key, V value) { + _map[key] = value; + } + + Iterable get keys => _map.keys; + + V? remove(Object? key) => _map.remove(key); + + void clear() => _map.clear(); +} + +int switchList(List list) => switch (list) { + [_, _, ...] => 2, + [_] => 1, + [] => 0, + }; + +int switchMap(Map map) => switch (map) { + {0: _} => 1, + {} => 0, + {...} => 2, + }; + +main() { + expect(0, switchList([])); + expect(1, switchList([0])); + expect(2, switchList([0, 1])); + expect(0, switchList(NegativeLengthList([]))); + expect(1, switchList(NegativeLengthList([0]))); + expect(2, switchList(NegativeLengthList([0, 1]))); + + expect(0, switchMap({})); + expect(1, switchMap({0: ''})); + expect(2, switchMap({1: ''})); + expect(0, switchMap(NegativeLengthMap({}))); + expect(1, switchMap(NegativeLengthMap({0: ''}))); + expect(2, switchMap(NegativeLengthMap({1: ''}))); +} + +expect(expected, actual) { + if (expected != actual) throw 'Expected $expected, actual $actual'; +} diff --git a/pkg/front_end/testcases/patterns/negative_length.dart.strong.expect b/pkg/front_end/testcases/patterns/negative_length.dart.strong.expect new file mode 100644 index 00000000000..e5a7204f7a4 --- /dev/null +++ b/pkg/front_end/testcases/patterns/negative_length.dart.strong.expect @@ -0,0 +1,293 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; +import "dart:collection" as col; +import "dart:math" as math; + +import "dart:collection"; + +abstract class _NegativeLengthList&Object&ListMixin = core::Object with col::ListMixin /*isAnonymousMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthList&Object&ListMixin + : super core::Object::•() + ; + mixin-super-stub get first() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::first}; + mixin-super-stub set first(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void + return super.{col::ListMixin::first} = value; + mixin-super-stub get last() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::last}; + mixin-super-stub set last(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void + return super.{col::ListMixin::last} = value; + mixin-super-stub get iterator() → core::Iterator + return super.{col::ListMixin::iterator}; + mixin-super-stub method elementAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::elementAt}(index); + mixin-super-stub method followedBy(covariant-by-class core::Iterable other) → core::Iterable + return super.{col::ListMixin::followedBy}(other); + mixin-super-stub method forEach((self::_NegativeLengthList&Object&ListMixin::E%) → void action) → void + return super.{col::ListMixin::forEach}(action); + mixin-super-stub get isEmpty() → core::bool + return super.{col::ListMixin::isEmpty}; + mixin-super-stub get isNotEmpty() → core::bool + return super.{col::ListMixin::isNotEmpty}; + mixin-super-stub get single() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::single}; + mixin-super-stub method contains(core::Object? element) → core::bool + return super.{col::ListMixin::contains}(element); + mixin-super-stub method every((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool + return super.{col::ListMixin::every}(test); + mixin-super-stub method any((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool + return super.{col::ListMixin::any}(test); + mixin-super-stub method firstWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C1}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::firstWhere}(test, orElse: orElse); + mixin-super-stub method lastWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C1}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::lastWhere}(test, orElse: orElse); + mixin-super-stub method singleWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C1}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::singleWhere}(test, orElse: orElse); + mixin-super-stub method join([core::String separator = #C2]) → core::String + return super.{col::ListMixin::join}(separator); + mixin-super-stub method where((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::where}(test); + mixin-super-stub method whereType() → core::Iterable + return super.{col::ListMixin::whereType}(); + mixin-super-stub method map((self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::map::T% f) → core::Iterable + return super.{col::ListMixin::map}(f); + mixin-super-stub method expand((self::_NegativeLengthList&Object&ListMixin::E%) → core::Iterable f) → core::Iterable + return super.{col::ListMixin::expand}(f); + mixin-super-stub method reduce(covariant-by-class (self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::E% combine) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::reduce}(combine); + mixin-super-stub method fold(self::_NegativeLengthList&Object&ListMixin::fold::T% initialValue, (self::_NegativeLengthList&Object&ListMixin::fold::T%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::fold::T% combine) → self::_NegativeLengthList&Object&ListMixin::fold::T% + return super.{col::ListMixin::fold}(initialValue, combine); + mixin-super-stub method skip(core::int count) → core::Iterable + return super.{col::ListMixin::skip}(count); + mixin-super-stub method skipWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::skipWhile}(test); + mixin-super-stub method take(core::int count) → core::Iterable + return super.{col::ListMixin::take}(count); + mixin-super-stub method takeWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::takeWhile}(test); + mixin-super-stub method toList({core::bool growable = #C3}) → core::List + return super.{col::ListMixin::toList}(growable: growable); + mixin-super-stub method toSet() → core::Set + return super.{col::ListMixin::toSet}(); + mixin-super-stub method add(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void + return super.{col::ListMixin::add}(element); + mixin-super-stub method addAll(covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::addAll}(iterable); + mixin-super-stub method remove(core::Object? element) → core::bool + return super.{col::ListMixin::remove}(element); + mixin-super-stub method _closeGap(core::int start, core::int end) → void + return super.{col::ListMixin::_closeGap}(start, end); + mixin-super-stub method removeWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void + return super.{col::ListMixin::removeWhere}(test); + mixin-super-stub method retainWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void + return super.{col::ListMixin::retainWhere}(test); + mixin-super-stub method _filter((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, core::bool retainMatching) → void + return super.{col::ListMixin::_filter}(test, retainMatching); + mixin-super-stub method clear() → void + return super.{col::ListMixin::clear}(); + mixin-super-stub method cast() → core::List + return super.{col::ListMixin::cast}(); + mixin-super-stub method removeLast() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::removeLast}(); + mixin-super-stub method sort([(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) →? core::int compare = #C1]) → void + return super.{col::ListMixin::sort}(compare); + mixin-super-stub method shuffle([math::Random? random = #C1]) → void + return super.{col::ListMixin::shuffle}(random); + mixin-super-stub method asMap() → core::Map + return super.{col::ListMixin::asMap}(); + mixin-super-stub operator +(covariant-by-class core::List other) → core::List + return super.{col::ListMixin::+}(other); + mixin-super-stub method sublist(core::int start, [core::int? end = #C1]) → core::List + return super.{col::ListMixin::sublist}(start, end); + mixin-super-stub method getRange(core::int start, core::int end) → core::Iterable + return super.{col::ListMixin::getRange}(start, end); + mixin-super-stub method removeRange(core::int start, core::int end) → void + return super.{col::ListMixin::removeRange}(start, end); + mixin-super-stub method fillRange(core::int start, core::int end, [covariant-by-class self::_NegativeLengthList&Object&ListMixin::E? fill = #C1]) → void + return super.{col::ListMixin::fillRange}(start, end, fill); + mixin-super-stub method setRange(core::int start, core::int end, covariant-by-class core::Iterable iterable, [core::int skipCount = #C4]) → void + return super.{col::ListMixin::setRange}(start, end, iterable, skipCount); + mixin-super-stub method replaceRange(core::int start, core::int end, covariant-by-class core::Iterable newContents) → void + return super.{col::ListMixin::replaceRange}(start, end, newContents); + mixin-super-stub method indexOf(covariant-by-class core::Object? element, [core::int start = #C4]) → core::int + return super.{col::ListMixin::indexOf}(element, start); + mixin-super-stub method indexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int start = #C4]) → core::int + return super.{col::ListMixin::indexWhere}(test, start); + mixin-super-stub method lastIndexOf(covariant-by-class core::Object? element, [core::int? start = #C1]) → core::int + return super.{col::ListMixin::lastIndexOf}(element, start); + mixin-super-stub method lastIndexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int? start = #C1]) → core::int + return super.{col::ListMixin::lastIndexWhere}(test, start); + mixin-super-stub method insert(core::int index, covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void + return super.{col::ListMixin::insert}(index, element); + mixin-super-stub method removeAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::removeAt}(index); + mixin-super-stub method insertAll(core::int index, covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::insertAll}(index, iterable); + mixin-super-stub method setAll(core::int index, covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::setAll}(index, iterable); + mixin-super-stub get reversed() → core::Iterable + return super.{col::ListMixin::reversed}; + mixin-super-stub method toString() → core::String + return super.{col::ListMixin::toString}(); +} +class NegativeLengthList extends self::_NegativeLengthList&Object&ListMixin { + final field core::List _list; + constructor •(core::List _list) → self::NegativeLengthList + : self::NegativeLengthList::_list = _list, super self::_NegativeLengthList&Object&ListMixin::•() + ; + get length() → core::int + return this.{self::NegativeLengthList::_list}{core::List}.{core::List::length}{core::int}.{core::num::<=}(0){(core::num) → core::bool} ?{core::int} 1.{core::int::unary-}(){() → core::int} : this.{self::NegativeLengthList::_list}{core::List}.{core::List::length}{core::int}; + set length(core::int value) → void { + this.{self::NegativeLengthList::_list}{core::List}.{core::List::length} = value; + } + operator [](core::int index) → self::NegativeLengthList::E% + return this.{self::NegativeLengthList::_list}{core::List}.{core::List::[]}(index){(core::int) → self::NegativeLengthList::E%}; + operator []=(core::int index, covariant-by-class self::NegativeLengthList::E% value) → void { + this.{self::NegativeLengthList::_list}{core::List}.{core::List::[]=}(index, value){(core::int, self::NegativeLengthList::E%) → void}; + } +} +abstract class _NegativeLengthMap&Object&MapMixin = core::Object with col::MapMixin /*isAnonymousMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthMap&Object&MapMixin + : super core::Object::•() + ; + abstract mixin-stub operator [](core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; -> col::MapMixin::[] + abstract mixin-stub operator []=(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class self::_NegativeLengthMap&Object&MapMixin::V% value) → void; -> col::MapMixin::[]= + abstract mixin-stub method remove(core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; -> col::MapMixin::remove + abstract mixin-stub method clear() → void; -> col::MapMixin::clear + mixin-super-stub get length() → core::int + return super.{col::MapMixin::length}; + abstract mixin-stub get keys() → core::Iterable; -> col::MapMixin::keys + mixin-super-stub method cast() → core::Map + return super.{col::MapMixin::cast}(); + mixin-super-stub method forEach((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void action) → void + return super.{col::MapMixin::forEach}(action); + mixin-super-stub method addAll(covariant-by-class core::Map other) → void + return super.{col::MapMixin::addAll}(other); + mixin-super-stub method containsValue(core::Object? value) → core::bool + return super.{col::MapMixin::containsValue}(value); + mixin-super-stub method putIfAbsent(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class () → self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent) → self::_NegativeLengthMap&Object&MapMixin::V% + return super.{col::MapMixin::putIfAbsent}(key, ifAbsent); + mixin-super-stub method update(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update, {covariant-by-class () →? self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent = #C1}) → self::_NegativeLengthMap&Object&MapMixin::V% + return super.{col::MapMixin::update}(key, update, ifAbsent: ifAbsent); + mixin-super-stub method updateAll(covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update) → void + return super.{col::MapMixin::updateAll}(update); + mixin-super-stub get entries() → core::Iterable> + return super.{col::MapMixin::entries}; + mixin-super-stub method map((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::MapEntry transform) → core::Map + return super.{col::MapMixin::map}(transform); + mixin-super-stub method addEntries(covariant-by-class core::Iterable> newEntries) → void + return super.{col::MapMixin::addEntries}(newEntries); + mixin-super-stub method removeWhere((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::bool test) → void + return super.{col::MapMixin::removeWhere}(test); + mixin-super-stub method containsKey(core::Object? key) → core::bool + return super.{col::MapMixin::containsKey}(key); + mixin-super-stub get isEmpty() → core::bool + return super.{col::MapMixin::isEmpty}; + mixin-super-stub get isNotEmpty() → core::bool + return super.{col::MapMixin::isNotEmpty}; + mixin-super-stub get values() → core::Iterable + return super.{col::MapMixin::values}; + mixin-super-stub method toString() → core::String + return super.{col::MapMixin::toString}(); +} +class NegativeLengthMap extends self::_NegativeLengthMap&Object&MapMixin { + final field core::Map _map; + constructor •(core::Map _map) → self::NegativeLengthMap + : self::NegativeLengthMap::_map = _map, super self::_NegativeLengthMap&Object&MapMixin::•() + ; + get length() → core::int + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(0){(core::num) → core::bool} ?{core::int} 1.{core::int::unary-}(){() → core::int} : this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::length}{core::int}; + operator [](core::Object? key) → self::NegativeLengthMap::V? + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::[]}(key){(core::Object?) → self::NegativeLengthMap::V?}; + operator []=(covariant-by-class self::NegativeLengthMap::K% key, covariant-by-class self::NegativeLengthMap::V% value) → void { + this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::[]=}(key, value){(self::NegativeLengthMap::K%, self::NegativeLengthMap::V%) → void}; + } + get keys() → core::Iterable + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::keys}{core::Iterable}; + method remove(core::Object? key) → self::NegativeLengthMap::V? + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::remove}(key){(core::Object?) → self::NegativeLengthMap::V?}; + method clear() → void + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::clear}(){() → void}; +} +static method switchList(core::List list) → core::int + return block { + core::int #t1; + final synthesized core::List #0#0 = list; + late final synthesized core::int #0#1 = #0#0.{core::List::length}{core::int}; + #L1: + { + { + if(#0#1.{core::num::>=}(#C5){(core::num) → core::bool}) { + #t1 = 2; + break #L1; + } + } + { + if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C6) { + #t1 = 1; + break #L1; + } + } + { + if(#0#1.{core::num::<=}(#C4){(core::num) → core::bool}) { + #t1 = 0; + break #L1; + } + } + } + } =>#t1; +static method switchMap(core::Map map) → core::int + return block { + core::int #t2; + final synthesized core::Map #0#0 = map; + late final synthesized core::int #0#1 = #0#0.{core::Map::length}{core::int}; + #L2: + { + { + if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C6 && #0#0.{core::Map::containsKey}(#C4){(core::Object?) → core::bool} && (let final dynamic #t3 = #0#0.{core::Map::[]}(#C4){(core::Object?) → core::String?} in true)) { + #t2 = 1; + break #L2; + } + } + { + if(#0#1.{core::num::<=}(#C4){(core::num) → core::bool}) { + #t2 = 0; + break #L2; + } + } + { + if(true) { + #t2 = 2; + break #L2; + } + } + } + } =>#t2; +static method main() → dynamic { + self::expect(0, self::switchList([])); + self::expect(1, self::switchList([0])); + self::expect(2, self::switchList([0, 1])); + self::expect(0, self::switchList(new self::NegativeLengthList::•([]))); + self::expect(1, self::switchList(new self::NegativeLengthList::•([0]))); + self::expect(2, self::switchList(new self::NegativeLengthList::•([0, 1]))); + self::expect(0, self::switchMap({})); + self::expect(1, self::switchMap({0: ""})); + self::expect(2, self::switchMap({1: ""})); + self::expect(0, self::switchMap(new self::NegativeLengthMap::•({}))); + self::expect(1, self::switchMap(new self::NegativeLengthMap::•({0: ""}))); + self::expect(2, self::switchMap(new self::NegativeLengthMap::•({1: ""}))); +} +static method expect(dynamic expected, dynamic actual) → dynamic { + if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) + throw "Expected ${expected}, actual ${actual}"; +} + +constants { + #C1 = null + #C2 = "" + #C3 = true + #C4 = 0 + #C5 = 2 + #C6 = 1 +} diff --git a/pkg/front_end/testcases/patterns/negative_length.dart.strong.transformed.expect b/pkg/front_end/testcases/patterns/negative_length.dart.strong.transformed.expect new file mode 100644 index 00000000000..19213cee2cd --- /dev/null +++ b/pkg/front_end/testcases/patterns/negative_length.dart.strong.transformed.expect @@ -0,0 +1,781 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; +import "dart:collection" as col; +import "dart:_internal" as _in; +import "dart:math" as math; + +import "dart:collection"; + +abstract class _NegativeLengthList&Object&ListMixin extends core::Object implements col::ListMixin /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthList&Object&ListMixin + : super core::Object::•() + ; + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ first() → self::_NegativeLengthList&Object&ListMixin::E% { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + return this.{core::List::[]}(0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + } + set /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ first(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + this.{core::List::[]=}(0, value){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ last() → self::_NegativeLengthList&Object&ListMixin::E% { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + return this.{core::List::[]}(this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + } + set /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ last(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + this.{core::List::[]=}(this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}, value){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + @#C3 + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ iterator() → core::Iterator + return new _in::ListIterator::•(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ elementAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% + return this.{core::List::[]}(index){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ followedBy(covariant-by-class core::Iterable other) → core::Iterable + return _in::FollowedByIterable::firstEfficient(this, other); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ forEach((self::_NegativeLengthList&Object&ListMixin::E%) → void action) → void { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + action(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + } + @#C3 + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ isEmpty() → core::bool + return this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0; + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ isNotEmpty() → core::bool + return !this.{col::ListMixin::isEmpty}{core::bool}; + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ single() → self::_NegativeLengthList&Object&ListMixin::E% { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + if(this.{core::List::length}{core::int}.{core::num::>}(1){(core::num) → core::bool}) + throw _in::IterableElementError::tooMany(); + return this.{core::List::[]}(0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ contains(core::Object? element) → core::bool { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%} =={core::Object::==}{(core::Object) → core::bool} element) + return true; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + return false; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ every((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(!test(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return false; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + return true; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ any((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(test(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return true; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + return false; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ firstWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C2}) → self::_NegativeLengthList&Object&ListMixin::E% { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + self::_NegativeLengthList&Object&ListMixin::E% element = this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + if(test(element){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return element; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + if(!(orElse == null)) + return orElse{() → self::_NegativeLengthList&Object&ListMixin::E%}(){() → self::_NegativeLengthList&Object&ListMixin::E%}; + throw _in::IterableElementError::noElement(); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C2}) → self::_NegativeLengthList&Object&ListMixin::E% { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = length.{core::num::-}(1){(core::num) → core::int}; i.{core::num::>=}(0){(core::num) → core::bool}; i = i.{core::num::-}(1){(core::num) → core::int}) { + self::_NegativeLengthList&Object&ListMixin::E% element = this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + if(test(element){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return element; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + if(!(orElse == null)) + return orElse{() → self::_NegativeLengthList&Object&ListMixin::E%}(){() → self::_NegativeLengthList&Object&ListMixin::E%}; + throw _in::IterableElementError::noElement(); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ singleWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C2}) → self::_NegativeLengthList&Object&ListMixin::E% { + core::int length = this.{core::List::length}{core::int}; + late self::_NegativeLengthList&Object&ListMixin::E% match; + core::bool matchFound = false; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + self::_NegativeLengthList&Object&ListMixin::E% element = this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + if(test(element){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) { + if(matchFound) { + throw _in::IterableElementError::tooMany(); + } + matchFound = true; + match = element; + } + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + if(matchFound) + return match; + if(!(orElse == null)) + return orElse{() → self::_NegativeLengthList&Object&ListMixin::E%}(){() → self::_NegativeLengthList&Object&ListMixin::E%}; + throw _in::IterableElementError::noElement(); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ join([core::String separator = #C4]) → core::String { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + return ""; + core::StringBuffer buffer = let final core::StringBuffer #t1 = new core::StringBuffer::•() in block { + #t1.{core::StringBuffer::writeAll}(this, separator){(core::Iterable, [core::String]) → void}; + } =>#t1; + return buffer.{core::StringBuffer::toString}(){() → core::String}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ where((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return new _in::WhereIterable::•(this, test); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ whereType() → core::Iterable + return new _in::WhereTypeIterable::•(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ map((self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::map::T% f) → core::Iterable + return new _in::MappedListIterable::•(this, f); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ expand((self::_NegativeLengthList&Object&ListMixin::E%) → core::Iterable f) → core::Iterable + return new _in::ExpandIterable::•(this, f); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ reduce(covariant-by-class (self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::E% combine) → self::_NegativeLengthList&Object&ListMixin::E% { + core::int length = this.{core::List::length}{core::int}; + if(length =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + self::_NegativeLengthList&Object&ListMixin::E% value = this.{core::List::[]}(0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + for (core::int i = 1; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + value = combine(value, this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::E%}; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + return value; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ fold(self::_NegativeLengthList&Object&ListMixin::fold::T% initialValue, (self::_NegativeLengthList&Object&ListMixin::fold::T%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::fold::T% combine) → self::_NegativeLengthList&Object&ListMixin::fold::T% { + self::_NegativeLengthList&Object&ListMixin::fold::T% value = initialValue; + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + value = combine(value, this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::fold::T%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::fold::T%}; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + return value; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ skip(core::int count) → core::Iterable + return new _in::SubListIterable::•(this, count, null); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ skipWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable { + return new _in::SkipWhileIterable::•(this, test); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ take(core::int count) → core::Iterable + return new _in::SubListIterable::•(this, 0, _in::checkNotNullable(count, "count")); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ takeWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable { + return new _in::TakeWhileIterable::•(this, test); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toList({core::bool growable = #C5}) → core::List { + if(this.{col::ListMixin::isEmpty}{core::bool}) + return core::List::empty(growable: growable); + self::_NegativeLengthList&Object&ListMixin::E% first = this.{core::List::[]}(0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + core::List result = core::List::filled(this.{core::List::length}{core::int}, first, growable: growable); + for (core::int i = 1; i.{core::num::<}(this.{core::List::length}{core::int}){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + result.{core::List::[]=}(i, this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + return result; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toSet() → core::Set { + core::Set result = new col::_Set::•(); + for (core::int i = 0; i.{core::num::<}(this.{core::List::length}{core::int}){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + result.{core::Set::add}(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}; + } + return result; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ add(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void { + this.{core::List::[]=}(let final core::int #t2 = this.{core::List::length}{core::int} in let final core::int #t3 = this.{core::List::length} = #t2.{core::num::+}(1){(core::num) → core::int} in #t2, element){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ addAll(covariant-by-class core::Iterable iterable) → void { + core::int i = this.{core::List::length}{core::int}; + { + synthesized core::Iterator :sync-for-iterator = iterable.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthList&Object&ListMixin::E% element = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthList&Object&ListMixin::E%}; + { + assert(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} i || (throw new core::ConcurrentModificationError::•(this))); + this.{col::ListMixin::add}(element){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + i = i.{core::num::+}(1){(core::num) → core::int}; + } + } + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ remove(core::Object? element) → core::bool { + for (core::int i = 0; i.{core::num::<}(this.{core::List::length}{core::int}){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%} =={core::Object::==}{(core::Object) → core::bool} element) { + this.{col::ListMixin::_closeGap}(i, i.{core::num::+}(1){(core::num) → core::int}){(core::int, core::int) → void}; + return true; + } + } + return false; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _closeGap(core::int start, core::int end) → void { + core::int length = this.{core::List::length}{core::int}; + assert(0.{core::num::<=}(start){(core::num) → core::bool}); + assert(start.{core::num::<}(end){(core::num) → core::bool}); + assert(end.{core::num::<=}(length){(core::num) → core::bool}); + core::int size = end.{core::num::-}(start){(core::num) → core::int}; + for (core::int i = end; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + this.{core::List::[]=}(i.{core::num::-}(size){(core::num) → core::int}, this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + this.{core::List::length} = length.{core::num::-}(size){(core::num) → core::int}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void { + this.{col::ListMixin::_filter}(test, false){((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool, core::bool) → void}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ retainWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void { + this.{col::ListMixin::_filter}(test, true){((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool, core::bool) → void}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _filter((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, core::bool retainMatching) → void { + core::List retained = core::_GrowableList::•(0); + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + self::_NegativeLengthList&Object&ListMixin::E% element = this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + if(test(element){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool} =={core::Object::==}{(core::Object) → core::bool} retainMatching) { + retained.{core::List::add}(element){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + if(!(retained.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + this.{col::ListMixin::setRange}(0, retained.{core::List::length}{core::int}, retained){(core::int, core::int, core::Iterable, [core::int]) → void}; + this.{core::List::length} = retained.{core::List::length}{core::int}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ clear() → void { + this.{core::List::length} = 0; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ cast() → core::List + return core::List::castFrom(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeLast() → self::_NegativeLengthList&Object&ListMixin::E% { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) { + throw _in::IterableElementError::noElement(); + } + self::_NegativeLengthList&Object&ListMixin::E% result = this.{core::List::[]}(this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + this.{core::List::length} = this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}; + return result; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ sort([(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) →? core::int compare = #C2]) → void { + _in::Sort::sort(this, let final (self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) →? core::int #t4 = compare in #t4 == null ?{(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → core::int} #C6 : #t4{(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → core::int}); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ shuffle([math::Random? random = #C2]) → void { + random == null ?{math::Random} random = math::Random::•() : null; + if(random{math::Random} == null) + throw "!"; + core::int length = this.{core::List::length}{core::int}; + while (length.{core::num::>}(1){(core::num) → core::bool}) { + core::int pos = random{math::Random}.{math::Random::nextInt}(length){(core::int) → core::int}; + length = length.{core::num::-}(1){(core::num) → core::int}; + self::_NegativeLengthList&Object&ListMixin::E% tmp = this.{core::List::[]}(length){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + this.{core::List::[]=}(length, this.{core::List::[]}(pos){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + this.{core::List::[]=}(pos, tmp){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ asMap() → core::Map { + return new _in::ListMapView::•(this); + } + operator /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ +(covariant-by-class core::List other) → core::List + return block { + final core::List #t5 = core::List::of(this); + #t5.{core::List::addAll}{Invariant}(other){(core::Iterable) → void}; + } =>#t5; + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ sublist(core::int start, [core::int? end = #C2]) → core::List { + core::int listLength = this.{core::List::length}{core::int}; + end == null ?{core::int} end = listLength : null; + if(end{core::int} == null) + throw "!"; + core::RangeError::checkValidRange(start, end{core::int}, listLength); + return core::List::from(this.{col::ListMixin::getRange}(start, end{core::int}){(core::int, core::int) → core::Iterable}); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ getRange(core::int start, core::int end) → core::Iterable { + core::RangeError::checkValidRange(start, end, this.{core::List::length}{core::int}); + return new _in::SubListIterable::•(this, start, end); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeRange(core::int start, core::int end) → void { + core::RangeError::checkValidRange(start, end, this.{core::List::length}{core::int}); + if(end.{core::num::>}(start){(core::num) → core::bool}) { + this.{col::ListMixin::_closeGap}(start, end){(core::int, core::int) → void}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ fillRange(core::int start, core::int end, [covariant-by-class self::_NegativeLengthList&Object&ListMixin::E? fill = #C2]) → void { + self::_NegativeLengthList&Object&ListMixin::E% value = let self::_NegativeLengthList&Object&ListMixin::E? #t6 = fill in #t6 == null ?{self::_NegativeLengthList&Object&ListMixin::E%} let self::_NegativeLengthList&Object&ListMixin::E? #t7 = #t6 in #t7 == null ?{self::_NegativeLengthList&Object&ListMixin::E%} #t7 as{ForNonNullableByDefault} self::_NegativeLengthList&Object&ListMixin::E% : #t7{self::_NegativeLengthList&Object&ListMixin::E%} : #t6{self::_NegativeLengthList&Object&ListMixin::E%}; + core::RangeError::checkValidRange(start, end, this.{core::List::length}{core::int}); + for (core::int i = start; i.{core::num::<}(end){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + this.{core::List::[]=}(i, value){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ setRange(core::int start, core::int end, covariant-by-class core::Iterable iterable, [core::int skipCount = #C7]) → void { + core::RangeError::checkValidRange(start, end, this.{core::List::length}{core::int}); + core::int length = end.{core::num::-}(start){(core::num) → core::int}; + if(length =={core::num::==}{(core::Object) → core::bool} 0) + return; + core::RangeError::checkNotNegative(skipCount, "skipCount"); + core::List otherList; + core::int otherStart; + if(iterable is{ForNonNullableByDefault} core::List) { + otherList = iterable{core::List}; + otherStart = skipCount; + } + else { + otherList = iterable.{core::Iterable::skip}(skipCount){(core::int) → core::Iterable}.{core::Iterable::toList}(growable: false){({growable: core::bool}) → core::List}; + otherStart = 0; + } + if(otherStart.{core::num::+}(length){(core::num) → core::int}.{core::num::>}(otherList.{core::List::length}{core::int}){(core::num) → core::bool}) { + throw _in::IterableElementError::tooFew(); + } + if(otherStart.{core::num::<}(start){(core::num) → core::bool}) { + for (core::int i = length.{core::num::-}(1){(core::num) → core::int}; i.{core::num::>=}(0){(core::num) → core::bool}; i = i.{core::num::-}(1){(core::num) → core::int}) { + this.{core::List::[]=}(start.{core::num::+}(i){(core::num) → core::int}, otherList.{core::List::[]}(otherStart.{core::num::+}(i){(core::num) → core::int}){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + else { + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + this.{core::List::[]=}(start.{core::num::+}(i){(core::num) → core::int}, otherList.{core::List::[]}(otherStart.{core::num::+}(i){(core::num) → core::int}){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ replaceRange(core::int start, core::int end, covariant-by-class core::Iterable newContents) → void { + core::RangeError::checkValidRange(start, end, this.{core::List::length}{core::int}); + if(start =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int}) { + this.{col::ListMixin::addAll}(newContents){(core::Iterable) → void}; + return; + } + if(!(newContents is{ForNonNullableByDefault} _in::EfficientLengthIterable)) { + newContents = newContents.{core::Iterable::toList}(){({growable: core::bool}) → core::List}; + } + core::int removeLength = end.{core::num::-}(start){(core::num) → core::int}; + core::int insertLength = newContents.{core::Iterable::length}{core::int}; + if(removeLength.{core::num::>=}(insertLength){(core::num) → core::bool}) { + core::int insertEnd = start.{core::num::+}(insertLength){(core::num) → core::int}; + this.{col::ListMixin::setRange}(start, insertEnd, newContents){(core::int, core::int, core::Iterable, [core::int]) → void}; + if(removeLength.{core::num::>}(insertLength){(core::num) → core::bool}) { + this.{col::ListMixin::_closeGap}(insertEnd, end){(core::int, core::int) → void}; + } + } + else + if(end =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int}) { + core::int i = start; + { + synthesized core::Iterator :sync-for-iterator = newContents.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthList&Object&ListMixin::E% element = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthList&Object&ListMixin::E%}; + { + if(i.{core::num::<}(end){(core::num) → core::bool}) { + this.{core::List::[]=}(i, element){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + else { + this.{col::ListMixin::add}(element){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + i = i.{core::num::+}(1){(core::num) → core::int}; + } + } + } + } + else { + core::int delta = insertLength.{core::num::-}(removeLength){(core::num) → core::int}; + core::int oldLength = this.{core::List::length}{core::int}; + core::int insertEnd = start.{core::num::+}(insertLength){(core::num) → core::int}; + for (core::int i = oldLength.{core::num::-}(delta){(core::num) → core::int}; i.{core::num::<}(oldLength){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + this.{col::ListMixin::add}(this.{core::List::[]}(i.{core::num::>}(0){(core::num) → core::bool} ?{core::int} i : 0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + if(insertEnd.{core::num::<}(oldLength){(core::num) → core::bool}) { + this.{col::ListMixin::setRange}(insertEnd, oldLength, this, end){(core::int, core::int, core::Iterable, [core::int]) → void}; + } + this.{col::ListMixin::setRange}(start, insertEnd, newContents){(core::int, core::int, core::Iterable, [core::int]) → void}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ indexOf(covariant-by-class core::Object? element, [core::int start = #C7]) → core::int { + if(start.{core::num::<}(0){(core::num) → core::bool}) + start = 0; + for (core::int i = start; i.{core::num::<}(this.{core::List::length}{core::int}){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%} =={core::Object::==}{(core::Object) → core::bool} element) + return i; + } + return 1.{core::int::unary-}(){() → core::int}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ indexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int start = #C7]) → core::int { + if(start.{core::num::<}(0){(core::num) → core::bool}) + start = 0; + for (core::int i = start; i.{core::num::<}(this.{core::List::length}{core::int}){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(test(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return i; + } + return 1.{core::int::unary-}(){() → core::int}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastIndexOf(covariant-by-class core::Object? element, [core::int? start = #C2]) → core::int { + if(start == null || start{core::int}.{core::num::>=}(this.{core::List::length}{core::int}){(core::num) → core::bool}) + start = this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}; + if(start{core::int} == null) + throw "!"; + for (core::int i = start{core::int}; i.{core::num::>=}(0){(core::num) → core::bool}; i = i.{core::num::-}(1){(core::num) → core::int}) { + if(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%} =={core::Object::==}{(core::Object) → core::bool} element) + return i; + } + return 1.{core::int::unary-}(){() → core::int}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastIndexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int? start = #C2]) → core::int { + if(start == null || start{core::int}.{core::num::>=}(this.{core::List::length}{core::int}){(core::num) → core::bool}) + start = this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}; + if(start{core::int} == null) + throw "!"; + for (core::int i = start{core::int}; i.{core::num::>=}(0){(core::num) → core::bool}; i = i.{core::num::-}(1){(core::num) → core::int}) { + if(test(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return i; + } + return 1.{core::int::unary-}(){() → core::int}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ insert(core::int index, covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void { + _in::checkNotNullable(index, "index"); + core::int length = this.{core::List::length}{core::int}; + core::RangeError::checkValueInInterval(index, 0, length, "index"); + this.{col::ListMixin::add}(element){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + if(!(index =={core::num::==}{(core::Object) → core::bool} length)) { + this.{col::ListMixin::setRange}(index.{core::num::+}(1){(core::num) → core::int}, length.{core::num::+}(1){(core::num) → core::int}, this, index){(core::int, core::int, core::Iterable, [core::int]) → void}; + this.{core::List::[]=}(index, element){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% { + self::_NegativeLengthList&Object&ListMixin::E% result = this.{core::List::[]}(index){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + this.{col::ListMixin::_closeGap}(index, index.{core::num::+}(1){(core::num) → core::int}){(core::int, core::int) → void}; + return result; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ insertAll(core::int index, covariant-by-class core::Iterable iterable) → void { + core::RangeError::checkValueInInterval(index, 0, this.{core::List::length}{core::int}, "index"); + if(index =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int}) { + this.{col::ListMixin::addAll}(iterable){(core::Iterable) → void}; + return; + } + if(!(iterable is{ForNonNullableByDefault} _in::EfficientLengthIterable) || core::identical(iterable, this)) { + iterable = iterable.{core::Iterable::toList}(){({growable: core::bool}) → core::List}; + } + core::int insertionLength = iterable.{core::Iterable::length}{core::int}; + if(insertionLength =={core::num::==}{(core::Object) → core::bool} 0) { + return; + } + core::int oldLength = this.{core::List::length}{core::int}; + for (core::int i = oldLength.{core::num::-}(insertionLength){(core::num) → core::int}; i.{core::num::<}(oldLength){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + this.{col::ListMixin::add}(this.{core::List::[]}(i.{core::num::>}(0){(core::num) → core::bool} ?{core::int} i : 0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + if(!(iterable.{core::Iterable::length}{core::int} =={core::num::==}{(core::Object) → core::bool} insertionLength)) { + this.{core::List::length} = this.{core::List::length}{core::int}.{core::num::-}(insertionLength){(core::num) → core::int}; + throw new core::ConcurrentModificationError::•(iterable); + } + core::int oldCopyStart = index.{core::num::+}(insertionLength){(core::num) → core::int}; + if(oldCopyStart.{core::num::<}(oldLength){(core::num) → core::bool}) { + this.{col::ListMixin::setRange}(oldCopyStart, oldLength, this, index){(core::int, core::int, core::Iterable, [core::int]) → void}; + } + this.{col::ListMixin::setAll}(index, iterable){(core::int, core::Iterable) → void}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ setAll(core::int index, covariant-by-class core::Iterable iterable) → void { + if(iterable is{ForNonNullableByDefault} core::List) { + this.{col::ListMixin::setRange}(index, index.{core::num::+}(iterable.{core::Iterable::length}{core::int}){(core::num) → core::int}, iterable){(core::int, core::int, core::Iterable, [core::int]) → void}; + } + else { + { + synthesized core::Iterator :sync-for-iterator = iterable.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthList&Object&ListMixin::E% element = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthList&Object&ListMixin::E%}; + { + this.{core::List::[]=}(let final core::int #t8 = index in let final core::int #t9 = index = #t8.{core::num::+}(1){(core::num) → core::int} in #t8, element){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + } + } + } + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ reversed() → core::Iterable + return new _in::ReversedListIterable::•(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toString() → core::String + return col::IterableBase::iterableToFullString(this, "[", "]"); + static method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _compareAny(dynamic a, dynamic b) → core::int { + return core::Comparable::compare(a as{ForNonNullableByDefault} core::Comparable, b as{ForNonNullableByDefault} core::Comparable); + } +} +class NegativeLengthList extends self::_NegativeLengthList&Object&ListMixin { + final field core::List _list; + constructor •(core::List _list) → self::NegativeLengthList + : self::NegativeLengthList::_list = _list, super self::_NegativeLengthList&Object&ListMixin::•() + ; + get length() → core::int + return this.{self::NegativeLengthList::_list}{core::List}.{core::List::length}{core::int}.{core::num::<=}(0){(core::num) → core::bool} ?{core::int} 1.{core::int::unary-}(){() → core::int} : this.{self::NegativeLengthList::_list}{core::List}.{core::List::length}{core::int}; + set length(core::int value) → void { + this.{self::NegativeLengthList::_list}{core::List}.{core::List::length} = value; + } + operator [](core::int index) → self::NegativeLengthList::E% + return this.{self::NegativeLengthList::_list}{core::List}.{core::List::[]}(index){(core::int) → self::NegativeLengthList::E%}; + operator []=(core::int index, covariant-by-class self::NegativeLengthList::E% value) → void { + this.{self::NegativeLengthList::_list}{core::List}.{core::List::[]=}(index, value){(core::int, self::NegativeLengthList::E%) → void}; + } +} +abstract class _NegativeLengthMap&Object&MapMixin extends core::Object implements col::MapMixin /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthMap&Object&MapMixin + : super core::Object::•() + ; + abstract operator /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ [](core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; + abstract operator /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ []=(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class self::_NegativeLengthMap&Object&MapMixin::V% value) → void; + abstract method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ remove(core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; + abstract method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ clear() → void; + get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ length() → core::int + return this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::length}{core::int}; + abstract get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ keys() → core::Iterable; + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ cast() → core::Map + return core::Map::castFrom(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ forEach((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void action) → void { + { + synthesized core::Iterator :sync-for-iterator = this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + action(key, let self::_NegativeLengthMap&Object&MapMixin::V? #t10 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t10 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} let self::_NegativeLengthMap&Object&MapMixin::V? #t11 = #t10 in #t11 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t11 as{ForNonNullableByDefault} self::_NegativeLengthMap&Object&MapMixin::V% : #t11{self::_NegativeLengthMap&Object&MapMixin::V%} : #t10{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void}; + } + } + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ addAll(covariant-by-class core::Map other) → void { + other.{core::Map::forEach}((self::_NegativeLengthMap&Object&MapMixin::K% key, self::_NegativeLengthMap&Object&MapMixin::V% value) → void { + this.{col::MapMixin::[]=}(key, value){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void}; + }){((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void) → void}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ containsValue(core::Object? value) → core::bool { + { + synthesized core::Iterator :sync-for-iterator = this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + if(this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} =={core::Object::==}{(core::Object) → core::bool} value) + return true; + } + } + } + return false; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ putIfAbsent(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class () → self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent) → self::_NegativeLengthMap&Object&MapMixin::V% { + if(this.{col::MapMixin::containsKey}(key){(core::Object?) → core::bool}) { + return let self::_NegativeLengthMap&Object&MapMixin::V? #t12 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t12 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} let self::_NegativeLengthMap&Object&MapMixin::V? #t13 = #t12 in #t13 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t13 as{ForNonNullableByDefault} self::_NegativeLengthMap&Object&MapMixin::V% : #t13{self::_NegativeLengthMap&Object&MapMixin::V%} : #t12{self::_NegativeLengthMap&Object&MapMixin::V%}; + } + return let final self::_NegativeLengthMap&Object&MapMixin::K% #t14 = key in let final self::_NegativeLengthMap&Object&MapMixin::V% #t15 = ifAbsent(){() → self::_NegativeLengthMap&Object&MapMixin::V%} in let final void #t16 = this.{col::MapMixin::[]=}(#t14, #t15){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void} in #t15; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ update(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update, {covariant-by-class () →? self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent = #C2}) → self::_NegativeLengthMap&Object&MapMixin::V% { + if(this.{col::MapMixin::containsKey}(key){(core::Object?) → core::bool}) { + return let final self::_NegativeLengthMap&Object&MapMixin::K% #t17 = key in let final self::_NegativeLengthMap&Object&MapMixin::V% #t18 = update(let self::_NegativeLengthMap&Object&MapMixin::V? #t19 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t19 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} let self::_NegativeLengthMap&Object&MapMixin::V? #t20 = #t19 in #t20 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t20 as{ForNonNullableByDefault} self::_NegativeLengthMap&Object&MapMixin::V% : #t20{self::_NegativeLengthMap&Object&MapMixin::V%} : #t19{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V%} in let final void #t21 = this.{col::MapMixin::[]=}(#t17, #t18){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void} in #t18; + } + if(!(ifAbsent == null)) { + return let final self::_NegativeLengthMap&Object&MapMixin::K% #t22 = key in let final self::_NegativeLengthMap&Object&MapMixin::V% #t23 = ifAbsent{() → self::_NegativeLengthMap&Object&MapMixin::V%}(){() → self::_NegativeLengthMap&Object&MapMixin::V%} in let final void #t24 = this.{col::MapMixin::[]=}(#t22, #t23){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void} in #t23; + } + throw new core::ArgumentError::value(key, "key", "Key not in map."); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ updateAll(covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update) → void { + { + synthesized core::Iterator :sync-for-iterator = this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + this.{col::MapMixin::[]=}(key, update(key, let self::_NegativeLengthMap&Object&MapMixin::V? #t25 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t25 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} let self::_NegativeLengthMap&Object&MapMixin::V? #t26 = #t25 in #t26 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t26 as{ForNonNullableByDefault} self::_NegativeLengthMap&Object&MapMixin::V% : #t26{self::_NegativeLengthMap&Object&MapMixin::V%} : #t25{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void}; + } + } + } + } + get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ entries() → core::Iterable> { + return this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::map}>((self::_NegativeLengthMap&Object&MapMixin::K% key) → core::MapEntry => new core::MapEntry::_(key, let self::_NegativeLengthMap&Object&MapMixin::V? #t27 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t27 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} let self::_NegativeLengthMap&Object&MapMixin::V? #t28 = #t27 in #t28 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t28 as{ForNonNullableByDefault} self::_NegativeLengthMap&Object&MapMixin::V% : #t28{self::_NegativeLengthMap&Object&MapMixin::V%} : #t27{self::_NegativeLengthMap&Object&MapMixin::V%})){((self::_NegativeLengthMap&Object&MapMixin::K%) → core::MapEntry) → core::Iterable>}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ map((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::MapEntry transform) → core::Map { + core::Map result = {}; + { + synthesized core::Iterator :sync-for-iterator = this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + core::MapEntry entry = transform(key, let self::_NegativeLengthMap&Object&MapMixin::V? #t29 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t29 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} let self::_NegativeLengthMap&Object&MapMixin::V? #t30 = #t29 in #t30 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t30 as{ForNonNullableByDefault} self::_NegativeLengthMap&Object&MapMixin::V% : #t30{self::_NegativeLengthMap&Object&MapMixin::V%} : #t29{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::MapEntry}; + result.{core::Map::[]=}(entry.{core::MapEntry::key}{self::_NegativeLengthMap&Object&MapMixin::map::K2%}, entry.{core::MapEntry::value}{self::_NegativeLengthMap&Object&MapMixin::map::V2%}){(self::_NegativeLengthMap&Object&MapMixin::map::K2%, self::_NegativeLengthMap&Object&MapMixin::map::V2%) → void}; + } + } + } + return result; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ addEntries(covariant-by-class core::Iterable> newEntries) → void { + { + synthesized core::Iterator> :sync-for-iterator = newEntries.{core::Iterable::iterator}{core::Iterator>}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + core::MapEntry entry = :sync-for-iterator.{core::Iterator::current}{core::MapEntry}; + { + this.{col::MapMixin::[]=}(entry.{core::MapEntry::key}{self::_NegativeLengthMap&Object&MapMixin::K%}, entry.{core::MapEntry::value}{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void}; + } + } + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ removeWhere((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::bool test) → void { + core::List keysToRemove = core::_GrowableList::•(0); + { + synthesized core::Iterator :sync-for-iterator = this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + if(test(key, let self::_NegativeLengthMap&Object&MapMixin::V? #t31 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t31 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} let self::_NegativeLengthMap&Object&MapMixin::V? #t32 = #t31 in #t32 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t32 as{ForNonNullableByDefault} self::_NegativeLengthMap&Object&MapMixin::V% : #t32{self::_NegativeLengthMap&Object&MapMixin::V%} : #t31{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::bool}) + keysToRemove.{core::List::add}(key){(self::_NegativeLengthMap&Object&MapMixin::K%) → void}; + } + } + } + { + synthesized core::Iterator :sync-for-iterator = keysToRemove.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + this.{col::MapMixin::remove}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?}; + } + } + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ containsKey(core::Object? key) → core::bool + return this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::contains}(key){(core::Object?) → core::bool}; + get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ isEmpty() → core::bool + return this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::isEmpty}{core::bool}; + get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ isNotEmpty() → core::bool + return this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::isNotEmpty}{core::bool}; + get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ values() → core::Iterable + return new col::_MapBaseValueIterable::•(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ toString() → core::String + return col::MapBase::mapToString(this); +} +class NegativeLengthMap extends self::_NegativeLengthMap&Object&MapMixin { + final field core::Map _map; + constructor •(core::Map _map) → self::NegativeLengthMap + : self::NegativeLengthMap::_map = _map, super self::_NegativeLengthMap&Object&MapMixin::•() + ; + get length() → core::int + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(0){(core::num) → core::bool} ?{core::int} 1.{core::int::unary-}(){() → core::int} : this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::length}{core::int}; + operator [](core::Object? key) → self::NegativeLengthMap::V? + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::[]}(key){(core::Object?) → self::NegativeLengthMap::V?}; + operator []=(covariant-by-class self::NegativeLengthMap::K% key, covariant-by-class self::NegativeLengthMap::V% value) → void { + this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::[]=}(key, value){(self::NegativeLengthMap::K%, self::NegativeLengthMap::V%) → void}; + } + get keys() → core::Iterable + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::keys}{core::Iterable}; + method remove(core::Object? key) → self::NegativeLengthMap::V? + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::remove}(key){(core::Object?) → self::NegativeLengthMap::V?}; + method clear() → void + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::clear}(){() → void}; +} +static method switchList(core::List list) → core::int + return block { + core::int #t33; + final synthesized core::List #0#0 = list; + function ##0#1#initializer() → core::int + return #0#0.{core::List::length}{core::int}; + late final synthesized core::int #0#1 = ##0#1#initializer(){() → core::int}; + #L1: + { + { + if(#0#1.{core::num::>=}(#C8){(core::num) → core::bool}) { + #t33 = 2; + break #L1; + } + } + { + if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C9) { + #t33 = 1; + break #L1; + } + } + { + if(#0#1.{core::num::<=}(#C7){(core::num) → core::bool}) { + #t33 = 0; + break #L1; + } + } + } + } =>#t33; +static method switchMap(core::Map map) → core::int + return block { + core::int #t34; + final synthesized core::Map #0#0 = map; + function ##0#1#initializer() → core::int + return #0#0.{core::Map::length}{core::int}; + late final synthesized core::int #0#1 = ##0#1#initializer(){() → core::int}; + #L2: + { + { + if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C9 && #0#0.{core::Map::containsKey}(#C7){(core::Object?) → core::bool} && (let final core::String? #t35 = #0#0.{core::Map::[]}(#C7){(core::Object?) → core::String?} in true)) { + #t34 = 1; + break #L2; + } + } + { + if(#0#1.{core::num::<=}(#C7){(core::num) → core::bool}) { + #t34 = 0; + break #L2; + } + } + { + if(true) { + #t34 = 2; + break #L2; + } + } + } + } =>#t34; +static method main() → dynamic { + self::expect(0, self::switchList(core::_GrowableList::•(0))); + self::expect(1, self::switchList(core::_GrowableList::_literal1(0))); + self::expect(2, self::switchList(core::_GrowableList::_literal2(0, 1))); + self::expect(0, self::switchList(new self::NegativeLengthList::•(core::_GrowableList::•(0)))); + self::expect(1, self::switchList(new self::NegativeLengthList::•(core::_GrowableList::_literal1(0)))); + self::expect(2, self::switchList(new self::NegativeLengthList::•(core::_GrowableList::_literal2(0, 1)))); + self::expect(0, self::switchMap({})); + self::expect(1, self::switchMap({0: ""})); + self::expect(2, self::switchMap({1: ""})); + self::expect(0, self::switchMap(new self::NegativeLengthMap::•({}))); + self::expect(1, self::switchMap(new self::NegativeLengthMap::•({0: ""}))); + self::expect(2, self::switchMap(new self::NegativeLengthMap::•({1: ""}))); +} +static method expect(dynamic expected, dynamic actual) → dynamic { + if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) + throw "Expected ${expected}, actual ${actual}"; +} + +constants { + #C1 = "vm:prefer-inline" + #C2 = null + #C3 = core::pragma {name:#C1, options:#C2} + #C4 = "" + #C5 = true + #C6 = static-tearoff col::ListMixin::_compareAny + #C7 = 0 + #C8 = 2 + #C9 = 1 +} + +Extra constant evaluation status: +Evaluated: InstanceInvocation @ org-dartlang-sdk:///sdk/lib/collection/list.dart:492:12 -> IntConstant(-1) +Evaluated: InstanceInvocation @ org-dartlang-sdk:///sdk/lib/collection/list.dart:500:12 -> IntConstant(-1) +Evaluated: InstanceInvocation @ org-dartlang-sdk:///sdk/lib/collection/list.dart:512:12 -> IntConstant(-1) +Evaluated: InstanceInvocation @ org-dartlang-sdk:///sdk/lib/collection/list.dart:524:12 -> IntConstant(-1) +Evaluated: InstanceInvocation @ org-dartlang-testcase:///negative_length.dart:12:41 -> IntConstant(-1) +Evaluated: InstanceInvocation @ org-dartlang-testcase:///negative_length.dart:30:40 -> IntConstant(-1) +Extra constant evaluation: evaluated: 1467, effectively constant: 6 diff --git a/pkg/front_end/testcases/patterns/negative_length.dart.textual_outline.expect b/pkg/front_end/testcases/patterns/negative_length.dart.textual_outline.expect new file mode 100644 index 00000000000..db190db98c5 --- /dev/null +++ b/pkg/front_end/testcases/patterns/negative_length.dart.textual_outline.expect @@ -0,0 +1,26 @@ +import 'dart:collection'; + +class NegativeLengthList with ListMixin { + final List _list; + NegativeLengthList(this._list); + int get length => _list.length <= 0 ? -1 : _list.length; + void set length(int value) {} + E operator [](int index) => _list[index]; + void operator []=(int index, E value) {} +} + +class NegativeLengthMap with MapMixin { + final Map _map; + NegativeLengthMap(this._map); + int get length => _map.length <= 0 ? -1 : _map.length; + V? operator [](Object? key) => _map[key]; + void operator []=(K key, V value) {} + Iterable get keys => _map.keys; + V? remove(Object? key) => _map.remove(key); + void clear() => _map.clear(); +} + +int switchList(List list) => switch (list) { }; +int switchMap(Map map) => switch (map) { }; +main() {} +expect(expected, actual) {} diff --git a/pkg/front_end/testcases/patterns/negative_length.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/patterns/negative_length.dart.textual_outline_modelled.expect new file mode 100644 index 00000000000..8450adb3a08 --- /dev/null +++ b/pkg/front_end/testcases/patterns/negative_length.dart.textual_outline_modelled.expect @@ -0,0 +1,31 @@ +import 'dart:collection'; +class NegativeLengthList with ListMixin { + E operator [](int index) => _list[index]; + NegativeLengthList(this._list); + final List _list; + int get length => _list.length <= 0 ? -1 : _list.length; + void operator []=(int index, E value) {} + void set length(int value) {} +} +class NegativeLengthMap with MapMixin { + Iterable get keys => _map.keys; + NegativeLengthMap(this._map); + V? operator [](Object? key) => _map[key]; + V? remove(Object? key) => _map.remove(key); + final Map _map; + int get length => _map.length <= 0 ? -1 : _map.length; + void clear() => _map.clear(); + void operator []=(K key, V value) {} +} +int switchList(List list) => +switch (list) {} +---- unknown chunk starts ---- +; +---- unknown chunk ends ---- +int switchMap(Map map) => +switch (map) {} +---- unknown chunk starts ---- +; +---- unknown chunk ends ---- +expect(expected, actual) {} +main() {} diff --git a/pkg/front_end/testcases/patterns/negative_length.dart.weak.expect b/pkg/front_end/testcases/patterns/negative_length.dart.weak.expect new file mode 100644 index 00000000000..535529a79f6 --- /dev/null +++ b/pkg/front_end/testcases/patterns/negative_length.dart.weak.expect @@ -0,0 +1,296 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; +import "dart:collection" as col; +import "dart:math" as math; +import "dart:_internal" as _in; + +import "dart:collection"; + +abstract class _NegativeLengthList&Object&ListMixin = core::Object with col::ListMixin /*isAnonymousMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthList&Object&ListMixin + : super core::Object::•() + ; + mixin-super-stub get first() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::first}; + mixin-super-stub set first(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void + return super.{col::ListMixin::first} = value; + mixin-super-stub get last() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::last}; + mixin-super-stub set last(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void + return super.{col::ListMixin::last} = value; + mixin-super-stub get iterator() → core::Iterator + return super.{col::ListMixin::iterator}; + mixin-super-stub method elementAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::elementAt}(index); + mixin-super-stub method followedBy(covariant-by-class core::Iterable other) → core::Iterable + return super.{col::ListMixin::followedBy}(other); + mixin-super-stub method forEach((self::_NegativeLengthList&Object&ListMixin::E%) → void action) → void + return super.{col::ListMixin::forEach}(action); + mixin-super-stub get isEmpty() → core::bool + return super.{col::ListMixin::isEmpty}; + mixin-super-stub get isNotEmpty() → core::bool + return super.{col::ListMixin::isNotEmpty}; + mixin-super-stub get single() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::single}; + mixin-super-stub method contains(core::Object? element) → core::bool + return super.{col::ListMixin::contains}(element); + mixin-super-stub method every((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool + return super.{col::ListMixin::every}(test); + mixin-super-stub method any((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool + return super.{col::ListMixin::any}(test); + mixin-super-stub method firstWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C1}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::firstWhere}(test, orElse: orElse); + mixin-super-stub method lastWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C1}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::lastWhere}(test, orElse: orElse); + mixin-super-stub method singleWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C1}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::singleWhere}(test, orElse: orElse); + mixin-super-stub method join([core::String separator = #C2]) → core::String + return super.{col::ListMixin::join}(separator); + mixin-super-stub method where((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::where}(test); + mixin-super-stub method whereType() → core::Iterable + return super.{col::ListMixin::whereType}(); + mixin-super-stub method map((self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::map::T% f) → core::Iterable + return super.{col::ListMixin::map}(f); + mixin-super-stub method expand((self::_NegativeLengthList&Object&ListMixin::E%) → core::Iterable f) → core::Iterable + return super.{col::ListMixin::expand}(f); + mixin-super-stub method reduce(covariant-by-class (self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::E% combine) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::reduce}(combine); + mixin-super-stub method fold(self::_NegativeLengthList&Object&ListMixin::fold::T% initialValue, (self::_NegativeLengthList&Object&ListMixin::fold::T%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::fold::T% combine) → self::_NegativeLengthList&Object&ListMixin::fold::T% + return super.{col::ListMixin::fold}(initialValue, combine); + mixin-super-stub method skip(core::int count) → core::Iterable + return super.{col::ListMixin::skip}(count); + mixin-super-stub method skipWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::skipWhile}(test); + mixin-super-stub method take(core::int count) → core::Iterable + return super.{col::ListMixin::take}(count); + mixin-super-stub method takeWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::takeWhile}(test); + mixin-super-stub method toList({core::bool growable = #C3}) → core::List + return super.{col::ListMixin::toList}(growable: growable); + mixin-super-stub method toSet() → core::Set + return super.{col::ListMixin::toSet}(); + mixin-super-stub method add(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void + return super.{col::ListMixin::add}(element); + mixin-super-stub method addAll(covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::addAll}(iterable); + mixin-super-stub method remove(core::Object? element) → core::bool + return super.{col::ListMixin::remove}(element); + mixin-super-stub method _closeGap(core::int start, core::int end) → void + return super.{col::ListMixin::_closeGap}(start, end); + mixin-super-stub method removeWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void + return super.{col::ListMixin::removeWhere}(test); + mixin-super-stub method retainWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void + return super.{col::ListMixin::retainWhere}(test); + mixin-super-stub method _filter((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, core::bool retainMatching) → void + return super.{col::ListMixin::_filter}(test, retainMatching); + mixin-super-stub method clear() → void + return super.{col::ListMixin::clear}(); + mixin-super-stub method cast() → core::List + return super.{col::ListMixin::cast}(); + mixin-super-stub method removeLast() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::removeLast}(); + mixin-super-stub method sort([(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) →? core::int compare = #C1]) → void + return super.{col::ListMixin::sort}(compare); + mixin-super-stub method shuffle([math::Random? random = #C1]) → void + return super.{col::ListMixin::shuffle}(random); + mixin-super-stub method asMap() → core::Map + return super.{col::ListMixin::asMap}(); + mixin-super-stub operator +(covariant-by-class core::List other) → core::List + return super.{col::ListMixin::+}(other); + mixin-super-stub method sublist(core::int start, [core::int? end = #C1]) → core::List + return super.{col::ListMixin::sublist}(start, end); + mixin-super-stub method getRange(core::int start, core::int end) → core::Iterable + return super.{col::ListMixin::getRange}(start, end); + mixin-super-stub method removeRange(core::int start, core::int end) → void + return super.{col::ListMixin::removeRange}(start, end); + mixin-super-stub method fillRange(core::int start, core::int end, [covariant-by-class self::_NegativeLengthList&Object&ListMixin::E? fill = #C1]) → void + return super.{col::ListMixin::fillRange}(start, end, fill); + mixin-super-stub method setRange(core::int start, core::int end, covariant-by-class core::Iterable iterable, [core::int skipCount = #C4]) → void + return super.{col::ListMixin::setRange}(start, end, iterable, skipCount); + mixin-super-stub method replaceRange(core::int start, core::int end, covariant-by-class core::Iterable newContents) → void + return super.{col::ListMixin::replaceRange}(start, end, newContents); + mixin-super-stub method indexOf(covariant-by-class core::Object? element, [core::int start = #C4]) → core::int + return super.{col::ListMixin::indexOf}(element, start); + mixin-super-stub method indexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int start = #C4]) → core::int + return super.{col::ListMixin::indexWhere}(test, start); + mixin-super-stub method lastIndexOf(covariant-by-class core::Object? element, [core::int? start = #C1]) → core::int + return super.{col::ListMixin::lastIndexOf}(element, start); + mixin-super-stub method lastIndexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int? start = #C1]) → core::int + return super.{col::ListMixin::lastIndexWhere}(test, start); + mixin-super-stub method insert(core::int index, covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void + return super.{col::ListMixin::insert}(index, element); + mixin-super-stub method removeAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::removeAt}(index); + mixin-super-stub method insertAll(core::int index, covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::insertAll}(index, iterable); + mixin-super-stub method setAll(core::int index, covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::setAll}(index, iterable); + mixin-super-stub get reversed() → core::Iterable + return super.{col::ListMixin::reversed}; + mixin-super-stub method toString() → core::String + return super.{col::ListMixin::toString}(); +} +class NegativeLengthList extends self::_NegativeLengthList&Object&ListMixin { + final field core::List _list; + constructor •(core::List _list) → self::NegativeLengthList + : self::NegativeLengthList::_list = _list, super self::_NegativeLengthList&Object&ListMixin::•() + ; + get length() → core::int + return this.{self::NegativeLengthList::_list}{core::List}.{core::List::length}{core::int}.{core::num::<=}(0){(core::num) → core::bool} ?{core::int} 1.{core::int::unary-}(){() → core::int} : this.{self::NegativeLengthList::_list}{core::List}.{core::List::length}{core::int}; + set length(core::int value) → void { + this.{self::NegativeLengthList::_list}{core::List}.{core::List::length} = value; + } + operator [](core::int index) → self::NegativeLengthList::E% + return this.{self::NegativeLengthList::_list}{core::List}.{core::List::[]}(index){(core::int) → self::NegativeLengthList::E%}; + operator []=(core::int index, covariant-by-class self::NegativeLengthList::E% value) → void { + this.{self::NegativeLengthList::_list}{core::List}.{core::List::[]=}(index, value){(core::int, self::NegativeLengthList::E%) → void}; + } +} +abstract class _NegativeLengthMap&Object&MapMixin = core::Object with col::MapMixin /*isAnonymousMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthMap&Object&MapMixin + : super core::Object::•() + ; + abstract mixin-stub operator [](core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; -> col::MapMixin::[] + abstract mixin-stub operator []=(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class self::_NegativeLengthMap&Object&MapMixin::V% value) → void; -> col::MapMixin::[]= + abstract mixin-stub method remove(core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; -> col::MapMixin::remove + abstract mixin-stub method clear() → void; -> col::MapMixin::clear + mixin-super-stub get length() → core::int + return super.{col::MapMixin::length}; + abstract mixin-stub get keys() → core::Iterable; -> col::MapMixin::keys + mixin-super-stub method cast() → core::Map + return super.{col::MapMixin::cast}(); + mixin-super-stub method forEach((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void action) → void + return super.{col::MapMixin::forEach}(action); + mixin-super-stub method addAll(covariant-by-class core::Map other) → void + return super.{col::MapMixin::addAll}(other); + mixin-super-stub method containsValue(core::Object? value) → core::bool + return super.{col::MapMixin::containsValue}(value); + mixin-super-stub method putIfAbsent(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class () → self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent) → self::_NegativeLengthMap&Object&MapMixin::V% + return super.{col::MapMixin::putIfAbsent}(key, ifAbsent); + mixin-super-stub method update(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update, {covariant-by-class () →? self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent = #C1}) → self::_NegativeLengthMap&Object&MapMixin::V% + return super.{col::MapMixin::update}(key, update, ifAbsent: ifAbsent); + mixin-super-stub method updateAll(covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update) → void + return super.{col::MapMixin::updateAll}(update); + mixin-super-stub get entries() → core::Iterable> + return super.{col::MapMixin::entries}; + mixin-super-stub method map((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::MapEntry transform) → core::Map + return super.{col::MapMixin::map}(transform); + mixin-super-stub method addEntries(covariant-by-class core::Iterable> newEntries) → void + return super.{col::MapMixin::addEntries}(newEntries); + mixin-super-stub method removeWhere((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::bool test) → void + return super.{col::MapMixin::removeWhere}(test); + mixin-super-stub method containsKey(core::Object? key) → core::bool + return super.{col::MapMixin::containsKey}(key); + mixin-super-stub get isEmpty() → core::bool + return super.{col::MapMixin::isEmpty}; + mixin-super-stub get isNotEmpty() → core::bool + return super.{col::MapMixin::isNotEmpty}; + mixin-super-stub get values() → core::Iterable + return super.{col::MapMixin::values}; + mixin-super-stub method toString() → core::String + return super.{col::MapMixin::toString}(); +} +class NegativeLengthMap extends self::_NegativeLengthMap&Object&MapMixin { + final field core::Map _map; + constructor •(core::Map _map) → self::NegativeLengthMap + : self::NegativeLengthMap::_map = _map, super self::_NegativeLengthMap&Object&MapMixin::•() + ; + get length() → core::int + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(0){(core::num) → core::bool} ?{core::int} 1.{core::int::unary-}(){() → core::int} : this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::length}{core::int}; + operator [](core::Object? key) → self::NegativeLengthMap::V? + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::[]}(key){(core::Object?) → self::NegativeLengthMap::V?}; + operator []=(covariant-by-class self::NegativeLengthMap::K% key, covariant-by-class self::NegativeLengthMap::V% value) → void { + this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::[]=}(key, value){(self::NegativeLengthMap::K%, self::NegativeLengthMap::V%) → void}; + } + get keys() → core::Iterable + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::keys}{core::Iterable}; + method remove(core::Object? key) → self::NegativeLengthMap::V? + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::remove}(key){(core::Object?) → self::NegativeLengthMap::V?}; + method clear() → void + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::clear}(){() → void}; +} +static method switchList(core::List list) → core::int + return block { + core::int #t1; + final synthesized core::List #0#0 = list; + late final synthesized core::int #0#1 = #0#0.{core::List::length}{core::int}; + #L1: + { + { + if(#0#1.{core::num::>=}(#C5){(core::num) → core::bool}) { + #t1 = 2; + break #L1; + } + } + { + if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C6) { + #t1 = 1; + break #L1; + } + } + { + if(#0#1.{core::num::<=}(#C4){(core::num) → core::bool}) { + #t1 = 0; + break #L1; + } + } + throw new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); + } + } =>#t1; +static method switchMap(core::Map map) → core::int + return block { + core::int #t2; + final synthesized core::Map #0#0 = map; + late final synthesized core::int #0#1 = #0#0.{core::Map::length}{core::int}; + #L2: + { + { + if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C6 && #0#0.{core::Map::containsKey}(#C4){(core::Object?) → core::bool} && (let final dynamic #t3 = #0#0.{core::Map::[]}(#C4){(core::Object?) → core::String?} in true)) { + #t2 = 1; + break #L2; + } + } + { + if(#0#1.{core::num::<=}(#C4){(core::num) → core::bool}) { + #t2 = 0; + break #L2; + } + } + { + if(true) { + #t2 = 2; + break #L2; + } + } + throw new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); + } + } =>#t2; +static method main() → dynamic { + self::expect(0, self::switchList([])); + self::expect(1, self::switchList([0])); + self::expect(2, self::switchList([0, 1])); + self::expect(0, self::switchList(new self::NegativeLengthList::•([]))); + self::expect(1, self::switchList(new self::NegativeLengthList::•([0]))); + self::expect(2, self::switchList(new self::NegativeLengthList::•([0, 1]))); + self::expect(0, self::switchMap({})); + self::expect(1, self::switchMap({0: ""})); + self::expect(2, self::switchMap({1: ""})); + self::expect(0, self::switchMap(new self::NegativeLengthMap::•({}))); + self::expect(1, self::switchMap(new self::NegativeLengthMap::•({0: ""}))); + self::expect(2, self::switchMap(new self::NegativeLengthMap::•({1: ""}))); +} +static method expect(dynamic expected, dynamic actual) → dynamic { + if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) + throw "Expected ${expected}, actual ${actual}"; +} + +constants { + #C1 = null + #C2 = "" + #C3 = true + #C4 = 0 + #C5 = 2 + #C6 = 1 +} diff --git a/pkg/front_end/testcases/patterns/negative_length.dart.weak.modular.expect b/pkg/front_end/testcases/patterns/negative_length.dart.weak.modular.expect new file mode 100644 index 00000000000..535529a79f6 --- /dev/null +++ b/pkg/front_end/testcases/patterns/negative_length.dart.weak.modular.expect @@ -0,0 +1,296 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; +import "dart:collection" as col; +import "dart:math" as math; +import "dart:_internal" as _in; + +import "dart:collection"; + +abstract class _NegativeLengthList&Object&ListMixin = core::Object with col::ListMixin /*isAnonymousMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthList&Object&ListMixin + : super core::Object::•() + ; + mixin-super-stub get first() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::first}; + mixin-super-stub set first(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void + return super.{col::ListMixin::first} = value; + mixin-super-stub get last() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::last}; + mixin-super-stub set last(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void + return super.{col::ListMixin::last} = value; + mixin-super-stub get iterator() → core::Iterator + return super.{col::ListMixin::iterator}; + mixin-super-stub method elementAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::elementAt}(index); + mixin-super-stub method followedBy(covariant-by-class core::Iterable other) → core::Iterable + return super.{col::ListMixin::followedBy}(other); + mixin-super-stub method forEach((self::_NegativeLengthList&Object&ListMixin::E%) → void action) → void + return super.{col::ListMixin::forEach}(action); + mixin-super-stub get isEmpty() → core::bool + return super.{col::ListMixin::isEmpty}; + mixin-super-stub get isNotEmpty() → core::bool + return super.{col::ListMixin::isNotEmpty}; + mixin-super-stub get single() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::single}; + mixin-super-stub method contains(core::Object? element) → core::bool + return super.{col::ListMixin::contains}(element); + mixin-super-stub method every((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool + return super.{col::ListMixin::every}(test); + mixin-super-stub method any((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool + return super.{col::ListMixin::any}(test); + mixin-super-stub method firstWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C1}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::firstWhere}(test, orElse: orElse); + mixin-super-stub method lastWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C1}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::lastWhere}(test, orElse: orElse); + mixin-super-stub method singleWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C1}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::singleWhere}(test, orElse: orElse); + mixin-super-stub method join([core::String separator = #C2]) → core::String + return super.{col::ListMixin::join}(separator); + mixin-super-stub method where((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::where}(test); + mixin-super-stub method whereType() → core::Iterable + return super.{col::ListMixin::whereType}(); + mixin-super-stub method map((self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::map::T% f) → core::Iterable + return super.{col::ListMixin::map}(f); + mixin-super-stub method expand((self::_NegativeLengthList&Object&ListMixin::E%) → core::Iterable f) → core::Iterable + return super.{col::ListMixin::expand}(f); + mixin-super-stub method reduce(covariant-by-class (self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::E% combine) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::reduce}(combine); + mixin-super-stub method fold(self::_NegativeLengthList&Object&ListMixin::fold::T% initialValue, (self::_NegativeLengthList&Object&ListMixin::fold::T%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::fold::T% combine) → self::_NegativeLengthList&Object&ListMixin::fold::T% + return super.{col::ListMixin::fold}(initialValue, combine); + mixin-super-stub method skip(core::int count) → core::Iterable + return super.{col::ListMixin::skip}(count); + mixin-super-stub method skipWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::skipWhile}(test); + mixin-super-stub method take(core::int count) → core::Iterable + return super.{col::ListMixin::take}(count); + mixin-super-stub method takeWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::takeWhile}(test); + mixin-super-stub method toList({core::bool growable = #C3}) → core::List + return super.{col::ListMixin::toList}(growable: growable); + mixin-super-stub method toSet() → core::Set + return super.{col::ListMixin::toSet}(); + mixin-super-stub method add(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void + return super.{col::ListMixin::add}(element); + mixin-super-stub method addAll(covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::addAll}(iterable); + mixin-super-stub method remove(core::Object? element) → core::bool + return super.{col::ListMixin::remove}(element); + mixin-super-stub method _closeGap(core::int start, core::int end) → void + return super.{col::ListMixin::_closeGap}(start, end); + mixin-super-stub method removeWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void + return super.{col::ListMixin::removeWhere}(test); + mixin-super-stub method retainWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void + return super.{col::ListMixin::retainWhere}(test); + mixin-super-stub method _filter((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, core::bool retainMatching) → void + return super.{col::ListMixin::_filter}(test, retainMatching); + mixin-super-stub method clear() → void + return super.{col::ListMixin::clear}(); + mixin-super-stub method cast() → core::List + return super.{col::ListMixin::cast}(); + mixin-super-stub method removeLast() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::removeLast}(); + mixin-super-stub method sort([(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) →? core::int compare = #C1]) → void + return super.{col::ListMixin::sort}(compare); + mixin-super-stub method shuffle([math::Random? random = #C1]) → void + return super.{col::ListMixin::shuffle}(random); + mixin-super-stub method asMap() → core::Map + return super.{col::ListMixin::asMap}(); + mixin-super-stub operator +(covariant-by-class core::List other) → core::List + return super.{col::ListMixin::+}(other); + mixin-super-stub method sublist(core::int start, [core::int? end = #C1]) → core::List + return super.{col::ListMixin::sublist}(start, end); + mixin-super-stub method getRange(core::int start, core::int end) → core::Iterable + return super.{col::ListMixin::getRange}(start, end); + mixin-super-stub method removeRange(core::int start, core::int end) → void + return super.{col::ListMixin::removeRange}(start, end); + mixin-super-stub method fillRange(core::int start, core::int end, [covariant-by-class self::_NegativeLengthList&Object&ListMixin::E? fill = #C1]) → void + return super.{col::ListMixin::fillRange}(start, end, fill); + mixin-super-stub method setRange(core::int start, core::int end, covariant-by-class core::Iterable iterable, [core::int skipCount = #C4]) → void + return super.{col::ListMixin::setRange}(start, end, iterable, skipCount); + mixin-super-stub method replaceRange(core::int start, core::int end, covariant-by-class core::Iterable newContents) → void + return super.{col::ListMixin::replaceRange}(start, end, newContents); + mixin-super-stub method indexOf(covariant-by-class core::Object? element, [core::int start = #C4]) → core::int + return super.{col::ListMixin::indexOf}(element, start); + mixin-super-stub method indexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int start = #C4]) → core::int + return super.{col::ListMixin::indexWhere}(test, start); + mixin-super-stub method lastIndexOf(covariant-by-class core::Object? element, [core::int? start = #C1]) → core::int + return super.{col::ListMixin::lastIndexOf}(element, start); + mixin-super-stub method lastIndexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int? start = #C1]) → core::int + return super.{col::ListMixin::lastIndexWhere}(test, start); + mixin-super-stub method insert(core::int index, covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void + return super.{col::ListMixin::insert}(index, element); + mixin-super-stub method removeAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::removeAt}(index); + mixin-super-stub method insertAll(core::int index, covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::insertAll}(index, iterable); + mixin-super-stub method setAll(core::int index, covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::setAll}(index, iterable); + mixin-super-stub get reversed() → core::Iterable + return super.{col::ListMixin::reversed}; + mixin-super-stub method toString() → core::String + return super.{col::ListMixin::toString}(); +} +class NegativeLengthList extends self::_NegativeLengthList&Object&ListMixin { + final field core::List _list; + constructor •(core::List _list) → self::NegativeLengthList + : self::NegativeLengthList::_list = _list, super self::_NegativeLengthList&Object&ListMixin::•() + ; + get length() → core::int + return this.{self::NegativeLengthList::_list}{core::List}.{core::List::length}{core::int}.{core::num::<=}(0){(core::num) → core::bool} ?{core::int} 1.{core::int::unary-}(){() → core::int} : this.{self::NegativeLengthList::_list}{core::List}.{core::List::length}{core::int}; + set length(core::int value) → void { + this.{self::NegativeLengthList::_list}{core::List}.{core::List::length} = value; + } + operator [](core::int index) → self::NegativeLengthList::E% + return this.{self::NegativeLengthList::_list}{core::List}.{core::List::[]}(index){(core::int) → self::NegativeLengthList::E%}; + operator []=(core::int index, covariant-by-class self::NegativeLengthList::E% value) → void { + this.{self::NegativeLengthList::_list}{core::List}.{core::List::[]=}(index, value){(core::int, self::NegativeLengthList::E%) → void}; + } +} +abstract class _NegativeLengthMap&Object&MapMixin = core::Object with col::MapMixin /*isAnonymousMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthMap&Object&MapMixin + : super core::Object::•() + ; + abstract mixin-stub operator [](core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; -> col::MapMixin::[] + abstract mixin-stub operator []=(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class self::_NegativeLengthMap&Object&MapMixin::V% value) → void; -> col::MapMixin::[]= + abstract mixin-stub method remove(core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; -> col::MapMixin::remove + abstract mixin-stub method clear() → void; -> col::MapMixin::clear + mixin-super-stub get length() → core::int + return super.{col::MapMixin::length}; + abstract mixin-stub get keys() → core::Iterable; -> col::MapMixin::keys + mixin-super-stub method cast() → core::Map + return super.{col::MapMixin::cast}(); + mixin-super-stub method forEach((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void action) → void + return super.{col::MapMixin::forEach}(action); + mixin-super-stub method addAll(covariant-by-class core::Map other) → void + return super.{col::MapMixin::addAll}(other); + mixin-super-stub method containsValue(core::Object? value) → core::bool + return super.{col::MapMixin::containsValue}(value); + mixin-super-stub method putIfAbsent(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class () → self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent) → self::_NegativeLengthMap&Object&MapMixin::V% + return super.{col::MapMixin::putIfAbsent}(key, ifAbsent); + mixin-super-stub method update(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update, {covariant-by-class () →? self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent = #C1}) → self::_NegativeLengthMap&Object&MapMixin::V% + return super.{col::MapMixin::update}(key, update, ifAbsent: ifAbsent); + mixin-super-stub method updateAll(covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update) → void + return super.{col::MapMixin::updateAll}(update); + mixin-super-stub get entries() → core::Iterable> + return super.{col::MapMixin::entries}; + mixin-super-stub method map((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::MapEntry transform) → core::Map + return super.{col::MapMixin::map}(transform); + mixin-super-stub method addEntries(covariant-by-class core::Iterable> newEntries) → void + return super.{col::MapMixin::addEntries}(newEntries); + mixin-super-stub method removeWhere((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::bool test) → void + return super.{col::MapMixin::removeWhere}(test); + mixin-super-stub method containsKey(core::Object? key) → core::bool + return super.{col::MapMixin::containsKey}(key); + mixin-super-stub get isEmpty() → core::bool + return super.{col::MapMixin::isEmpty}; + mixin-super-stub get isNotEmpty() → core::bool + return super.{col::MapMixin::isNotEmpty}; + mixin-super-stub get values() → core::Iterable + return super.{col::MapMixin::values}; + mixin-super-stub method toString() → core::String + return super.{col::MapMixin::toString}(); +} +class NegativeLengthMap extends self::_NegativeLengthMap&Object&MapMixin { + final field core::Map _map; + constructor •(core::Map _map) → self::NegativeLengthMap + : self::NegativeLengthMap::_map = _map, super self::_NegativeLengthMap&Object&MapMixin::•() + ; + get length() → core::int + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(0){(core::num) → core::bool} ?{core::int} 1.{core::int::unary-}(){() → core::int} : this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::length}{core::int}; + operator [](core::Object? key) → self::NegativeLengthMap::V? + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::[]}(key){(core::Object?) → self::NegativeLengthMap::V?}; + operator []=(covariant-by-class self::NegativeLengthMap::K% key, covariant-by-class self::NegativeLengthMap::V% value) → void { + this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::[]=}(key, value){(self::NegativeLengthMap::K%, self::NegativeLengthMap::V%) → void}; + } + get keys() → core::Iterable + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::keys}{core::Iterable}; + method remove(core::Object? key) → self::NegativeLengthMap::V? + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::remove}(key){(core::Object?) → self::NegativeLengthMap::V?}; + method clear() → void + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::clear}(){() → void}; +} +static method switchList(core::List list) → core::int + return block { + core::int #t1; + final synthesized core::List #0#0 = list; + late final synthesized core::int #0#1 = #0#0.{core::List::length}{core::int}; + #L1: + { + { + if(#0#1.{core::num::>=}(#C5){(core::num) → core::bool}) { + #t1 = 2; + break #L1; + } + } + { + if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C6) { + #t1 = 1; + break #L1; + } + } + { + if(#0#1.{core::num::<=}(#C4){(core::num) → core::bool}) { + #t1 = 0; + break #L1; + } + } + throw new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); + } + } =>#t1; +static method switchMap(core::Map map) → core::int + return block { + core::int #t2; + final synthesized core::Map #0#0 = map; + late final synthesized core::int #0#1 = #0#0.{core::Map::length}{core::int}; + #L2: + { + { + if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C6 && #0#0.{core::Map::containsKey}(#C4){(core::Object?) → core::bool} && (let final dynamic #t3 = #0#0.{core::Map::[]}(#C4){(core::Object?) → core::String?} in true)) { + #t2 = 1; + break #L2; + } + } + { + if(#0#1.{core::num::<=}(#C4){(core::num) → core::bool}) { + #t2 = 0; + break #L2; + } + } + { + if(true) { + #t2 = 2; + break #L2; + } + } + throw new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); + } + } =>#t2; +static method main() → dynamic { + self::expect(0, self::switchList([])); + self::expect(1, self::switchList([0])); + self::expect(2, self::switchList([0, 1])); + self::expect(0, self::switchList(new self::NegativeLengthList::•([]))); + self::expect(1, self::switchList(new self::NegativeLengthList::•([0]))); + self::expect(2, self::switchList(new self::NegativeLengthList::•([0, 1]))); + self::expect(0, self::switchMap({})); + self::expect(1, self::switchMap({0: ""})); + self::expect(2, self::switchMap({1: ""})); + self::expect(0, self::switchMap(new self::NegativeLengthMap::•({}))); + self::expect(1, self::switchMap(new self::NegativeLengthMap::•({0: ""}))); + self::expect(2, self::switchMap(new self::NegativeLengthMap::•({1: ""}))); +} +static method expect(dynamic expected, dynamic actual) → dynamic { + if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) + throw "Expected ${expected}, actual ${actual}"; +} + +constants { + #C1 = null + #C2 = "" + #C3 = true + #C4 = 0 + #C5 = 2 + #C6 = 1 +} diff --git a/pkg/front_end/testcases/patterns/negative_length.dart.weak.outline.expect b/pkg/front_end/testcases/patterns/negative_length.dart.weak.outline.expect new file mode 100644 index 00000000000..5e3bb73d864 --- /dev/null +++ b/pkg/front_end/testcases/patterns/negative_length.dart.weak.outline.expect @@ -0,0 +1,215 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; +import "dart:collection" as col; +import "dart:math" as math; + +import "dart:collection"; + +abstract class _NegativeLengthList&Object&ListMixin = core::Object with col::ListMixin /*isAnonymousMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthList&Object&ListMixin + : super core::Object::•() + ; + mixin-super-stub get first() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::first}; + mixin-super-stub set first(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void + return super.{col::ListMixin::first} = value; + mixin-super-stub get last() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::last}; + mixin-super-stub set last(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void + return super.{col::ListMixin::last} = value; + mixin-super-stub get iterator() → core::Iterator + return super.{col::ListMixin::iterator}; + mixin-super-stub method elementAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::elementAt}(index); + mixin-super-stub method followedBy(covariant-by-class core::Iterable other) → core::Iterable + return super.{col::ListMixin::followedBy}(other); + mixin-super-stub method forEach((self::_NegativeLengthList&Object&ListMixin::E%) → void action) → void + return super.{col::ListMixin::forEach}(action); + mixin-super-stub get isEmpty() → core::bool + return super.{col::ListMixin::isEmpty}; + mixin-super-stub get isNotEmpty() → core::bool + return super.{col::ListMixin::isNotEmpty}; + mixin-super-stub get single() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::single}; + mixin-super-stub method contains(core::Object? element) → core::bool + return super.{col::ListMixin::contains}(element); + mixin-super-stub method every((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool + return super.{col::ListMixin::every}(test); + mixin-super-stub method any((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool + return super.{col::ListMixin::any}(test); + mixin-super-stub method firstWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::firstWhere}(test, orElse: orElse); + mixin-super-stub method lastWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::lastWhere}(test, orElse: orElse); + mixin-super-stub method singleWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse}) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::singleWhere}(test, orElse: orElse); + mixin-super-stub method join([core::String separator]) → core::String + return super.{col::ListMixin::join}(separator); + mixin-super-stub method where((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::where}(test); + mixin-super-stub method whereType() → core::Iterable + return super.{col::ListMixin::whereType}(); + mixin-super-stub method map((self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::map::T% f) → core::Iterable + return super.{col::ListMixin::map}(f); + mixin-super-stub method expand((self::_NegativeLengthList&Object&ListMixin::E%) → core::Iterable f) → core::Iterable + return super.{col::ListMixin::expand}(f); + mixin-super-stub method reduce(covariant-by-class (self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::E% combine) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::reduce}(combine); + mixin-super-stub method fold(self::_NegativeLengthList&Object&ListMixin::fold::T% initialValue, (self::_NegativeLengthList&Object&ListMixin::fold::T%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::fold::T% combine) → self::_NegativeLengthList&Object&ListMixin::fold::T% + return super.{col::ListMixin::fold}(initialValue, combine); + mixin-super-stub method skip(core::int count) → core::Iterable + return super.{col::ListMixin::skip}(count); + mixin-super-stub method skipWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::skipWhile}(test); + mixin-super-stub method take(core::int count) → core::Iterable + return super.{col::ListMixin::take}(count); + mixin-super-stub method takeWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return super.{col::ListMixin::takeWhile}(test); + mixin-super-stub method toList({core::bool growable}) → core::List + return super.{col::ListMixin::toList}(growable: growable); + mixin-super-stub method toSet() → core::Set + return super.{col::ListMixin::toSet}(); + mixin-super-stub method add(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void + return super.{col::ListMixin::add}(element); + mixin-super-stub method addAll(covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::addAll}(iterable); + mixin-super-stub method remove(core::Object? element) → core::bool + return super.{col::ListMixin::remove}(element); + mixin-super-stub method _closeGap(core::int start, core::int end) → void + return super.{col::ListMixin::_closeGap}(start, end); + mixin-super-stub method removeWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void + return super.{col::ListMixin::removeWhere}(test); + mixin-super-stub method retainWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void + return super.{col::ListMixin::retainWhere}(test); + mixin-super-stub method _filter((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, core::bool retainMatching) → void + return super.{col::ListMixin::_filter}(test, retainMatching); + mixin-super-stub method clear() → void + return super.{col::ListMixin::clear}(); + mixin-super-stub method cast() → core::List + return super.{col::ListMixin::cast}(); + mixin-super-stub method removeLast() → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::removeLast}(); + mixin-super-stub method sort([(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) →? core::int compare]) → void + return super.{col::ListMixin::sort}(compare); + mixin-super-stub method shuffle([math::Random? random]) → void + return super.{col::ListMixin::shuffle}(random); + mixin-super-stub method asMap() → core::Map + return super.{col::ListMixin::asMap}(); + mixin-super-stub operator +(covariant-by-class core::List other) → core::List + return super.{col::ListMixin::+}(other); + mixin-super-stub method sublist(core::int start, [core::int? end]) → core::List + return super.{col::ListMixin::sublist}(start, end); + mixin-super-stub method getRange(core::int start, core::int end) → core::Iterable + return super.{col::ListMixin::getRange}(start, end); + mixin-super-stub method removeRange(core::int start, core::int end) → void + return super.{col::ListMixin::removeRange}(start, end); + mixin-super-stub method fillRange(core::int start, core::int end, [covariant-by-class self::_NegativeLengthList&Object&ListMixin::E? fill]) → void + return super.{col::ListMixin::fillRange}(start, end, fill); + mixin-super-stub method setRange(core::int start, core::int end, covariant-by-class core::Iterable iterable, [core::int skipCount]) → void + return super.{col::ListMixin::setRange}(start, end, iterable, skipCount); + mixin-super-stub method replaceRange(core::int start, core::int end, covariant-by-class core::Iterable newContents) → void + return super.{col::ListMixin::replaceRange}(start, end, newContents); + mixin-super-stub method indexOf(covariant-by-class core::Object? element, [core::int start]) → core::int + return super.{col::ListMixin::indexOf}(element, start); + mixin-super-stub method indexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int start]) → core::int + return super.{col::ListMixin::indexWhere}(test, start); + mixin-super-stub method lastIndexOf(covariant-by-class core::Object? element, [core::int? start]) → core::int + return super.{col::ListMixin::lastIndexOf}(element, start); + mixin-super-stub method lastIndexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int? start]) → core::int + return super.{col::ListMixin::lastIndexWhere}(test, start); + mixin-super-stub method insert(core::int index, covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void + return super.{col::ListMixin::insert}(index, element); + mixin-super-stub method removeAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% + return super.{col::ListMixin::removeAt}(index); + mixin-super-stub method insertAll(core::int index, covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::insertAll}(index, iterable); + mixin-super-stub method setAll(core::int index, covariant-by-class core::Iterable iterable) → void + return super.{col::ListMixin::setAll}(index, iterable); + mixin-super-stub get reversed() → core::Iterable + return super.{col::ListMixin::reversed}; + mixin-super-stub method toString() → core::String + return super.{col::ListMixin::toString}(); +} +class NegativeLengthList extends self::_NegativeLengthList&Object&ListMixin { + final field core::List _list; + constructor •(core::List _list) → self::NegativeLengthList + ; + get length() → core::int + ; + set length(core::int value) → void + ; + operator [](core::int index) → self::NegativeLengthList::E% + ; + operator []=(core::int index, covariant-by-class self::NegativeLengthList::E% value) → void + ; +} +abstract class _NegativeLengthMap&Object&MapMixin = core::Object with col::MapMixin /*isAnonymousMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthMap&Object&MapMixin + : super core::Object::•() + ; + abstract mixin-stub operator [](core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; -> col::MapMixin::[] + abstract mixin-stub operator []=(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class self::_NegativeLengthMap&Object&MapMixin::V% value) → void; -> col::MapMixin::[]= + abstract mixin-stub method remove(core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; -> col::MapMixin::remove + abstract mixin-stub method clear() → void; -> col::MapMixin::clear + mixin-super-stub get length() → core::int + return super.{col::MapMixin::length}; + abstract mixin-stub get keys() → core::Iterable; -> col::MapMixin::keys + mixin-super-stub method cast() → core::Map + return super.{col::MapMixin::cast}(); + mixin-super-stub method forEach((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void action) → void + return super.{col::MapMixin::forEach}(action); + mixin-super-stub method addAll(covariant-by-class core::Map other) → void + return super.{col::MapMixin::addAll}(other); + mixin-super-stub method containsValue(core::Object? value) → core::bool + return super.{col::MapMixin::containsValue}(value); + mixin-super-stub method putIfAbsent(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class () → self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent) → self::_NegativeLengthMap&Object&MapMixin::V% + return super.{col::MapMixin::putIfAbsent}(key, ifAbsent); + mixin-super-stub method update(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update, {covariant-by-class () →? self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent}) → self::_NegativeLengthMap&Object&MapMixin::V% + return super.{col::MapMixin::update}(key, update, ifAbsent: ifAbsent); + mixin-super-stub method updateAll(covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update) → void + return super.{col::MapMixin::updateAll}(update); + mixin-super-stub get entries() → core::Iterable> + return super.{col::MapMixin::entries}; + mixin-super-stub method map((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::MapEntry transform) → core::Map + return super.{col::MapMixin::map}(transform); + mixin-super-stub method addEntries(covariant-by-class core::Iterable> newEntries) → void + return super.{col::MapMixin::addEntries}(newEntries); + mixin-super-stub method removeWhere((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::bool test) → void + return super.{col::MapMixin::removeWhere}(test); + mixin-super-stub method containsKey(core::Object? key) → core::bool + return super.{col::MapMixin::containsKey}(key); + mixin-super-stub get isEmpty() → core::bool + return super.{col::MapMixin::isEmpty}; + mixin-super-stub get isNotEmpty() → core::bool + return super.{col::MapMixin::isNotEmpty}; + mixin-super-stub get values() → core::Iterable + return super.{col::MapMixin::values}; + mixin-super-stub method toString() → core::String + return super.{col::MapMixin::toString}(); +} +class NegativeLengthMap extends self::_NegativeLengthMap&Object&MapMixin { + final field core::Map _map; + constructor •(core::Map _map) → self::NegativeLengthMap + ; + get length() → core::int + ; + operator [](core::Object? key) → self::NegativeLengthMap::V? + ; + operator []=(covariant-by-class self::NegativeLengthMap::K% key, covariant-by-class self::NegativeLengthMap::V% value) → void + ; + get keys() → core::Iterable + ; + method remove(core::Object? key) → self::NegativeLengthMap::V? + ; + method clear() → void + ; +} +static method switchList(core::List list) → core::int + ; +static method switchMap(core::Map map) → core::int + ; +static method main() → dynamic + ; +static method expect(dynamic expected, dynamic actual) → dynamic + ; diff --git a/pkg/front_end/testcases/patterns/negative_length.dart.weak.transformed.expect b/pkg/front_end/testcases/patterns/negative_length.dart.weak.transformed.expect new file mode 100644 index 00000000000..4253371688d --- /dev/null +++ b/pkg/front_end/testcases/patterns/negative_length.dart.weak.transformed.expect @@ -0,0 +1,783 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; +import "dart:collection" as col; +import "dart:_internal" as _in; +import "dart:math" as math; + +import "dart:collection"; + +abstract class _NegativeLengthList&Object&ListMixin extends core::Object implements col::ListMixin /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthList&Object&ListMixin + : super core::Object::•() + ; + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ first() → self::_NegativeLengthList&Object&ListMixin::E% { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + return this.{core::List::[]}(0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + } + set /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ first(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + this.{core::List::[]=}(0, value){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ last() → self::_NegativeLengthList&Object&ListMixin::E% { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + return this.{core::List::[]}(this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + } + set /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ last(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% value) → void { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + this.{core::List::[]=}(this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}, value){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + @#C3 + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ iterator() → core::Iterator + return new _in::ListIterator::•(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ elementAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% + return this.{core::List::[]}(index){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ followedBy(covariant-by-class core::Iterable other) → core::Iterable + return _in::FollowedByIterable::firstEfficient(this, other); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ forEach((self::_NegativeLengthList&Object&ListMixin::E%) → void action) → void { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + action(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + } + @#C3 + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ isEmpty() → core::bool + return this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0; + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ isNotEmpty() → core::bool + return !this.{col::ListMixin::isEmpty}{core::bool}; + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ single() → self::_NegativeLengthList&Object&ListMixin::E% { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + if(this.{core::List::length}{core::int}.{core::num::>}(1){(core::num) → core::bool}) + throw _in::IterableElementError::tooMany(); + return this.{core::List::[]}(0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ contains(core::Object? element) → core::bool { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%} =={core::Object::==}{(core::Object) → core::bool} element) + return true; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + return false; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ every((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(!test(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return false; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + return true; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ any((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::bool { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(test(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return true; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + return false; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ firstWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C2}) → self::_NegativeLengthList&Object&ListMixin::E% { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + self::_NegativeLengthList&Object&ListMixin::E% element = this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + if(test(element){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return element; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + if(!(orElse == null)) + return orElse{() → self::_NegativeLengthList&Object&ListMixin::E%}(){() → self::_NegativeLengthList&Object&ListMixin::E%}; + throw _in::IterableElementError::noElement(); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C2}) → self::_NegativeLengthList&Object&ListMixin::E% { + core::int length = this.{core::List::length}{core::int}; + for (core::int i = length.{core::num::-}(1){(core::num) → core::int}; i.{core::num::>=}(0){(core::num) → core::bool}; i = i.{core::num::-}(1){(core::num) → core::int}) { + self::_NegativeLengthList&Object&ListMixin::E% element = this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + if(test(element){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return element; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + if(!(orElse == null)) + return orElse{() → self::_NegativeLengthList&Object&ListMixin::E%}(){() → self::_NegativeLengthList&Object&ListMixin::E%}; + throw _in::IterableElementError::noElement(); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ singleWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_NegativeLengthList&Object&ListMixin::E% orElse = #C2}) → self::_NegativeLengthList&Object&ListMixin::E% { + core::int length = this.{core::List::length}{core::int}; + late self::_NegativeLengthList&Object&ListMixin::E% match; + core::bool matchFound = false; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + self::_NegativeLengthList&Object&ListMixin::E% element = this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + if(test(element){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) { + if(matchFound) { + throw _in::IterableElementError::tooMany(); + } + matchFound = true; + match = element; + } + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + if(matchFound) + return match; + if(!(orElse == null)) + return orElse{() → self::_NegativeLengthList&Object&ListMixin::E%}(){() → self::_NegativeLengthList&Object&ListMixin::E%}; + throw _in::IterableElementError::noElement(); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ join([core::String separator = #C4]) → core::String { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) + return ""; + core::StringBuffer buffer = let final core::StringBuffer #t1 = new core::StringBuffer::•() in block { + #t1.{core::StringBuffer::writeAll}(this, separator){(core::Iterable, [core::String]) → void}; + } =>#t1; + return buffer.{core::StringBuffer::toString}(){() → core::String}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ where((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable + return new _in::WhereIterable::•(this, test); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ whereType() → core::Iterable + return new _in::WhereTypeIterable::•(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ map((self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::map::T% f) → core::Iterable + return new _in::MappedListIterable::•(this, f); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ expand((self::_NegativeLengthList&Object&ListMixin::E%) → core::Iterable f) → core::Iterable + return new _in::ExpandIterable::•(this, f); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ reduce(covariant-by-class (self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::E% combine) → self::_NegativeLengthList&Object&ListMixin::E% { + core::int length = this.{core::List::length}{core::int}; + if(length =={core::num::==}{(core::Object) → core::bool} 0) + throw _in::IterableElementError::noElement(); + self::_NegativeLengthList&Object&ListMixin::E% value = this.{core::List::[]}(0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + for (core::int i = 1; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + value = combine(value, this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::E%}; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + return value; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ fold(self::_NegativeLengthList&Object&ListMixin::fold::T% initialValue, (self::_NegativeLengthList&Object&ListMixin::fold::T%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::fold::T% combine) → self::_NegativeLengthList&Object&ListMixin::fold::T% { + self::_NegativeLengthList&Object&ListMixin::fold::T% value = initialValue; + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + value = combine(value, this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::fold::T%, self::_NegativeLengthList&Object&ListMixin::E%) → self::_NegativeLengthList&Object&ListMixin::fold::T%}; + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + return value; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ skip(core::int count) → core::Iterable + return new _in::SubListIterable::•(this, count, null); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ skipWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable { + return new _in::SkipWhileIterable::•(this, test); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ take(core::int count) → core::Iterable + return new _in::SubListIterable::•(this, 0, _in::checkNotNullable(count, "count")); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ takeWhile((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → core::Iterable { + return new _in::TakeWhileIterable::•(this, test); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toList({core::bool growable = #C5}) → core::List { + if(this.{col::ListMixin::isEmpty}{core::bool}) + return core::List::empty(growable: growable); + self::_NegativeLengthList&Object&ListMixin::E% first = this.{core::List::[]}(0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + core::List result = core::List::filled(this.{core::List::length}{core::int}, first, growable: growable); + for (core::int i = 1; i.{core::num::<}(this.{core::List::length}{core::int}){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + result.{core::List::[]=}(i, this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + return result; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toSet() → core::Set { + core::Set result = new col::_Set::•(); + for (core::int i = 0; i.{core::num::<}(this.{core::List::length}{core::int}){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + result.{core::Set::add}(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}; + } + return result; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ add(covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void { + this.{core::List::[]=}(let final core::int #t2 = this.{core::List::length}{core::int} in let final core::int #t3 = this.{core::List::length} = #t2.{core::num::+}(1){(core::num) → core::int} in #t2, element){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ addAll(covariant-by-class core::Iterable iterable) → void { + core::int i = this.{core::List::length}{core::int}; + { + synthesized core::Iterator :sync-for-iterator = iterable.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthList&Object&ListMixin::E% element = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthList&Object&ListMixin::E%}; + { + assert(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} i || (throw new core::ConcurrentModificationError::•(this))); + this.{col::ListMixin::add}(element){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + i = i.{core::num::+}(1){(core::num) → core::int}; + } + } + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ remove(core::Object? element) → core::bool { + for (core::int i = 0; i.{core::num::<}(this.{core::List::length}{core::int}){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%} =={core::Object::==}{(core::Object) → core::bool} element) { + this.{col::ListMixin::_closeGap}(i, i.{core::num::+}(1){(core::num) → core::int}){(core::int, core::int) → void}; + return true; + } + } + return false; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _closeGap(core::int start, core::int end) → void { + core::int length = this.{core::List::length}{core::int}; + assert(0.{core::num::<=}(start){(core::num) → core::bool}); + assert(start.{core::num::<}(end){(core::num) → core::bool}); + assert(end.{core::num::<=}(length){(core::num) → core::bool}); + core::int size = end.{core::num::-}(start){(core::num) → core::int}; + for (core::int i = end; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + this.{core::List::[]=}(i.{core::num::-}(size){(core::num) → core::int}, this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + this.{core::List::length} = length.{core::num::-}(size){(core::num) → core::int}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void { + this.{col::ListMixin::_filter}(test, false){((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool, core::bool) → void}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ retainWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test) → void { + this.{col::ListMixin::_filter}(test, true){((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool, core::bool) → void}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _filter((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, core::bool retainMatching) → void { + core::List retained = core::_GrowableList::•(0); + core::int length = this.{core::List::length}{core::int}; + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + self::_NegativeLengthList&Object&ListMixin::E% element = this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + if(test(element){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool} =={core::Object::==}{(core::Object) → core::bool} retainMatching) { + retained.{core::List::add}(element){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + if(!(length =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + throw new core::ConcurrentModificationError::•(this); + } + } + if(!(retained.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int})) { + this.{col::ListMixin::setRange}(0, retained.{core::List::length}{core::int}, retained){(core::int, core::int, core::Iterable, [core::int]) → void}; + this.{core::List::length} = retained.{core::List::length}{core::int}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ clear() → void { + this.{core::List::length} = 0; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ cast() → core::List + return core::List::castFrom(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeLast() → self::_NegativeLengthList&Object&ListMixin::E% { + if(this.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} 0) { + throw _in::IterableElementError::noElement(); + } + self::_NegativeLengthList&Object&ListMixin::E% result = this.{core::List::[]}(this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + this.{core::List::length} = this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}; + return result; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ sort([(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) →? core::int compare = #C2]) → void { + _in::Sort::sort(this, let final (self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) →? core::int #t4 = compare in #t4 == null ?{(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → core::int} #C6 : #t4{(self::_NegativeLengthList&Object&ListMixin::E%, self::_NegativeLengthList&Object&ListMixin::E%) → core::int}); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ shuffle([math::Random? random = #C2]) → void { + random == null ?{math::Random} random = math::Random::•() : null; + if(random{math::Random} == null) + throw "!"; + core::int length = this.{core::List::length}{core::int}; + while (length.{core::num::>}(1){(core::num) → core::bool}) { + core::int pos = random{math::Random}.{math::Random::nextInt}(length){(core::int) → core::int}; + length = length.{core::num::-}(1){(core::num) → core::int}; + self::_NegativeLengthList&Object&ListMixin::E% tmp = this.{core::List::[]}(length){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + this.{core::List::[]=}(length, this.{core::List::[]}(pos){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + this.{core::List::[]=}(pos, tmp){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ asMap() → core::Map { + return new _in::ListMapView::•(this); + } + operator /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ +(covariant-by-class core::List other) → core::List + return block { + final core::List #t5 = core::List::of(this); + #t5.{core::List::addAll}{Invariant}(other){(core::Iterable) → void}; + } =>#t5; + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ sublist(core::int start, [core::int? end = #C2]) → core::List { + core::int listLength = this.{core::List::length}{core::int}; + end == null ?{core::int} end = listLength : null; + if(end{core::int} == null) + throw "!"; + core::RangeError::checkValidRange(start, end{core::int}, listLength); + return core::List::from(this.{col::ListMixin::getRange}(start, end{core::int}){(core::int, core::int) → core::Iterable}); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ getRange(core::int start, core::int end) → core::Iterable { + core::RangeError::checkValidRange(start, end, this.{core::List::length}{core::int}); + return new _in::SubListIterable::•(this, start, end); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeRange(core::int start, core::int end) → void { + core::RangeError::checkValidRange(start, end, this.{core::List::length}{core::int}); + if(end.{core::num::>}(start){(core::num) → core::bool}) { + this.{col::ListMixin::_closeGap}(start, end){(core::int, core::int) → void}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ fillRange(core::int start, core::int end, [covariant-by-class self::_NegativeLengthList&Object&ListMixin::E? fill = #C2]) → void { + self::_NegativeLengthList&Object&ListMixin::E% value = let self::_NegativeLengthList&Object&ListMixin::E? #t6 = fill in #t6 == null ?{self::_NegativeLengthList&Object&ListMixin::E%} #t6 : #t6{self::_NegativeLengthList&Object&ListMixin::E%}; + core::RangeError::checkValidRange(start, end, this.{core::List::length}{core::int}); + for (core::int i = start; i.{core::num::<}(end){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + this.{core::List::[]=}(i, value){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ setRange(core::int start, core::int end, covariant-by-class core::Iterable iterable, [core::int skipCount = #C7]) → void { + core::RangeError::checkValidRange(start, end, this.{core::List::length}{core::int}); + core::int length = end.{core::num::-}(start){(core::num) → core::int}; + if(length =={core::num::==}{(core::Object) → core::bool} 0) + return; + core::RangeError::checkNotNegative(skipCount, "skipCount"); + core::List otherList; + core::int otherStart; + if(iterable is{ForNonNullableByDefault} core::List) { + otherList = iterable{core::List}; + otherStart = skipCount; + } + else { + otherList = iterable.{core::Iterable::skip}(skipCount){(core::int) → core::Iterable}.{core::Iterable::toList}(growable: false){({growable: core::bool}) → core::List}; + otherStart = 0; + } + if(otherStart.{core::num::+}(length){(core::num) → core::int}.{core::num::>}(otherList.{core::List::length}{core::int}){(core::num) → core::bool}) { + throw _in::IterableElementError::tooFew(); + } + if(otherStart.{core::num::<}(start){(core::num) → core::bool}) { + for (core::int i = length.{core::num::-}(1){(core::num) → core::int}; i.{core::num::>=}(0){(core::num) → core::bool}; i = i.{core::num::-}(1){(core::num) → core::int}) { + this.{core::List::[]=}(start.{core::num::+}(i){(core::num) → core::int}, otherList.{core::List::[]}(otherStart.{core::num::+}(i){(core::num) → core::int}){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + else { + for (core::int i = 0; i.{core::num::<}(length){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + this.{core::List::[]=}(start.{core::num::+}(i){(core::num) → core::int}, otherList.{core::List::[]}(otherStart.{core::num::+}(i){(core::num) → core::int}){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ replaceRange(core::int start, core::int end, covariant-by-class core::Iterable newContents) → void { + core::RangeError::checkValidRange(start, end, this.{core::List::length}{core::int}); + if(start =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int}) { + this.{col::ListMixin::addAll}(newContents){(core::Iterable) → void}; + return; + } + if(!(newContents is{ForNonNullableByDefault} _in::EfficientLengthIterable)) { + newContents = newContents.{core::Iterable::toList}(){({growable: core::bool}) → core::List}; + } + core::int removeLength = end.{core::num::-}(start){(core::num) → core::int}; + core::int insertLength = newContents.{core::Iterable::length}{core::int}; + if(removeLength.{core::num::>=}(insertLength){(core::num) → core::bool}) { + core::int insertEnd = start.{core::num::+}(insertLength){(core::num) → core::int}; + this.{col::ListMixin::setRange}(start, insertEnd, newContents){(core::int, core::int, core::Iterable, [core::int]) → void}; + if(removeLength.{core::num::>}(insertLength){(core::num) → core::bool}) { + this.{col::ListMixin::_closeGap}(insertEnd, end){(core::int, core::int) → void}; + } + } + else + if(end =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int}) { + core::int i = start; + { + synthesized core::Iterator :sync-for-iterator = newContents.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthList&Object&ListMixin::E% element = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthList&Object&ListMixin::E%}; + { + if(i.{core::num::<}(end){(core::num) → core::bool}) { + this.{core::List::[]=}(i, element){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + else { + this.{col::ListMixin::add}(element){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + i = i.{core::num::+}(1){(core::num) → core::int}; + } + } + } + } + else { + core::int delta = insertLength.{core::num::-}(removeLength){(core::num) → core::int}; + core::int oldLength = this.{core::List::length}{core::int}; + core::int insertEnd = start.{core::num::+}(insertLength){(core::num) → core::int}; + for (core::int i = oldLength.{core::num::-}(delta){(core::num) → core::int}; i.{core::num::<}(oldLength){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + this.{col::ListMixin::add}(this.{core::List::[]}(i.{core::num::>}(0){(core::num) → core::bool} ?{core::int} i : 0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + if(insertEnd.{core::num::<}(oldLength){(core::num) → core::bool}) { + this.{col::ListMixin::setRange}(insertEnd, oldLength, this, end){(core::int, core::int, core::Iterable, [core::int]) → void}; + } + this.{col::ListMixin::setRange}(start, insertEnd, newContents){(core::int, core::int, core::Iterable, [core::int]) → void}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ indexOf(covariant-by-class core::Object? element, [core::int start = #C7]) → core::int { + if(start.{core::num::<}(0){(core::num) → core::bool}) + start = 0; + for (core::int i = start; i.{core::num::<}(this.{core::List::length}{core::int}){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%} =={core::Object::==}{(core::Object) → core::bool} element) + return i; + } + return 1.{core::int::unary-}(){() → core::int}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ indexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int start = #C7]) → core::int { + if(start.{core::num::<}(0){(core::num) → core::bool}) + start = 0; + for (core::int i = start; i.{core::num::<}(this.{core::List::length}{core::int}){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + if(test(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return i; + } + return 1.{core::int::unary-}(){() → core::int}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastIndexOf(covariant-by-class core::Object? element, [core::int? start = #C2]) → core::int { + if(start == null || start{core::int}.{core::num::>=}(this.{core::List::length}{core::int}){(core::num) → core::bool}) + start = this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}; + if(start{core::int} == null) + throw "!"; + for (core::int i = start{core::int}; i.{core::num::>=}(0){(core::num) → core::bool}; i = i.{core::num::-}(1){(core::num) → core::int}) { + if(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%} =={core::Object::==}{(core::Object) → core::bool} element) + return i; + } + return 1.{core::int::unary-}(){() → core::int}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ lastIndexWhere((self::_NegativeLengthList&Object&ListMixin::E%) → core::bool test, [core::int? start = #C2]) → core::int { + if(start == null || start{core::int}.{core::num::>=}(this.{core::List::length}{core::int}){(core::num) → core::bool}) + start = this.{core::List::length}{core::int}.{core::num::-}(1){(core::num) → core::int}; + if(start{core::int} == null) + throw "!"; + for (core::int i = start{core::int}; i.{core::num::>=}(0){(core::num) → core::bool}; i = i.{core::num::-}(1){(core::num) → core::int}) { + if(test(this.{core::List::[]}(i){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → core::bool}) + return i; + } + return 1.{core::int::unary-}(){() → core::int}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ insert(core::int index, covariant-by-class self::_NegativeLengthList&Object&ListMixin::E% element) → void { + _in::checkNotNullable(index, "index"); + core::int length = this.{core::List::length}{core::int}; + core::RangeError::checkValueInInterval(index, 0, length, "index"); + this.{col::ListMixin::add}(element){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + if(!(index =={core::num::==}{(core::Object) → core::bool} length)) { + this.{col::ListMixin::setRange}(index.{core::num::+}(1){(core::num) → core::int}, length.{core::num::+}(1){(core::num) → core::int}, this, index){(core::int, core::int, core::Iterable, [core::int]) → void}; + this.{core::List::[]=}(index, element){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ removeAt(core::int index) → self::_NegativeLengthList&Object&ListMixin::E% { + self::_NegativeLengthList&Object&ListMixin::E% result = this.{core::List::[]}(index){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}; + this.{col::ListMixin::_closeGap}(index, index.{core::num::+}(1){(core::num) → core::int}){(core::int, core::int) → void}; + return result; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ insertAll(core::int index, covariant-by-class core::Iterable iterable) → void { + core::RangeError::checkValueInInterval(index, 0, this.{core::List::length}{core::int}, "index"); + if(index =={core::num::==}{(core::Object) → core::bool} this.{core::List::length}{core::int}) { + this.{col::ListMixin::addAll}(iterable){(core::Iterable) → void}; + return; + } + if(!(iterable is{ForNonNullableByDefault} _in::EfficientLengthIterable) || core::identical(iterable, this)) { + iterable = iterable.{core::Iterable::toList}(){({growable: core::bool}) → core::List}; + } + core::int insertionLength = iterable.{core::Iterable::length}{core::int}; + if(insertionLength =={core::num::==}{(core::Object) → core::bool} 0) { + return; + } + core::int oldLength = this.{core::List::length}{core::int}; + for (core::int i = oldLength.{core::num::-}(insertionLength){(core::num) → core::int}; i.{core::num::<}(oldLength){(core::num) → core::bool}; i = i.{core::num::+}(1){(core::num) → core::int}) { + this.{col::ListMixin::add}(this.{core::List::[]}(i.{core::num::>}(0){(core::num) → core::bool} ?{core::int} i : 0){(core::int) → self::_NegativeLengthList&Object&ListMixin::E%}){(self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + if(!(iterable.{core::Iterable::length}{core::int} =={core::num::==}{(core::Object) → core::bool} insertionLength)) { + this.{core::List::length} = this.{core::List::length}{core::int}.{core::num::-}(insertionLength){(core::num) → core::int}; + throw new core::ConcurrentModificationError::•(iterable); + } + core::int oldCopyStart = index.{core::num::+}(insertionLength){(core::num) → core::int}; + if(oldCopyStart.{core::num::<}(oldLength){(core::num) → core::bool}) { + this.{col::ListMixin::setRange}(oldCopyStart, oldLength, this, index){(core::int, core::int, core::Iterable, [core::int]) → void}; + } + this.{col::ListMixin::setAll}(index, iterable){(core::int, core::Iterable) → void}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ setAll(core::int index, covariant-by-class core::Iterable iterable) → void { + if(iterable is{ForNonNullableByDefault} core::List) { + this.{col::ListMixin::setRange}(index, index.{core::num::+}(iterable.{core::Iterable::length}{core::int}){(core::num) → core::int}, iterable){(core::int, core::int, core::Iterable, [core::int]) → void}; + } + else { + { + synthesized core::Iterator :sync-for-iterator = iterable.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthList&Object&ListMixin::E% element = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthList&Object&ListMixin::E%}; + { + this.{core::List::[]=}(let final core::int #t7 = index in let final core::int #t8 = index = #t7.{core::num::+}(1){(core::num) → core::int} in #t7, element){(core::int, self::_NegativeLengthList&Object&ListMixin::E%) → void}; + } + } + } + } + } + get /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ reversed() → core::Iterable + return new _in::ReversedListIterable::•(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ toString() → core::String + return col::IterableBase::iterableToFullString(this, "[", "]"); + static method /* from org-dartlang-sdk:///sdk/lib/collection/list.dart */ _compareAny(dynamic a, dynamic b) → core::int { + return core::Comparable::compare(a as{ForNonNullableByDefault} core::Comparable, b as{ForNonNullableByDefault} core::Comparable); + } +} +class NegativeLengthList extends self::_NegativeLengthList&Object&ListMixin { + final field core::List _list; + constructor •(core::List _list) → self::NegativeLengthList + : self::NegativeLengthList::_list = _list, super self::_NegativeLengthList&Object&ListMixin::•() + ; + get length() → core::int + return this.{self::NegativeLengthList::_list}{core::List}.{core::List::length}{core::int}.{core::num::<=}(0){(core::num) → core::bool} ?{core::int} 1.{core::int::unary-}(){() → core::int} : this.{self::NegativeLengthList::_list}{core::List}.{core::List::length}{core::int}; + set length(core::int value) → void { + this.{self::NegativeLengthList::_list}{core::List}.{core::List::length} = value; + } + operator [](core::int index) → self::NegativeLengthList::E% + return this.{self::NegativeLengthList::_list}{core::List}.{core::List::[]}(index){(core::int) → self::NegativeLengthList::E%}; + operator []=(core::int index, covariant-by-class self::NegativeLengthList::E% value) → void { + this.{self::NegativeLengthList::_list}{core::List}.{core::List::[]=}(index, value){(core::int, self::NegativeLengthList::E%) → void}; + } +} +abstract class _NegativeLengthMap&Object&MapMixin extends core::Object implements col::MapMixin /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/ { + const synthetic constructor •() → self::_NegativeLengthMap&Object&MapMixin + : super core::Object::•() + ; + abstract operator /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ [](core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; + abstract operator /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ []=(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class self::_NegativeLengthMap&Object&MapMixin::V% value) → void; + abstract method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ remove(core::Object? key) → self::_NegativeLengthMap&Object&MapMixin::V?; + abstract method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ clear() → void; + get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ length() → core::int + return this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::length}{core::int}; + abstract get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ keys() → core::Iterable; + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ cast() → core::Map + return core::Map::castFrom(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ forEach((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void action) → void { + { + synthesized core::Iterator :sync-for-iterator = this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + action(key, let self::_NegativeLengthMap&Object&MapMixin::V? #t9 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t9 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t9 : #t9{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void}; + } + } + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ addAll(covariant-by-class core::Map other) → void { + other.{core::Map::forEach}((self::_NegativeLengthMap&Object&MapMixin::K% key, self::_NegativeLengthMap&Object&MapMixin::V% value) → void { + this.{col::MapMixin::[]=}(key, value){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void}; + }){((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void) → void}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ containsValue(core::Object? value) → core::bool { + { + synthesized core::Iterator :sync-for-iterator = this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + if(this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} =={core::Object::==}{(core::Object) → core::bool} value) + return true; + } + } + } + return false; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ putIfAbsent(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class () → self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent) → self::_NegativeLengthMap&Object&MapMixin::V% { + if(this.{col::MapMixin::containsKey}(key){(core::Object?) → core::bool}) { + return let self::_NegativeLengthMap&Object&MapMixin::V? #t10 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t10 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t10 : #t10{self::_NegativeLengthMap&Object&MapMixin::V%}; + } + return let final self::_NegativeLengthMap&Object&MapMixin::K% #t11 = key in let final self::_NegativeLengthMap&Object&MapMixin::V% #t12 = ifAbsent(){() → self::_NegativeLengthMap&Object&MapMixin::V%} in let final void #t13 = this.{col::MapMixin::[]=}(#t11, #t12){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void} in #t12; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ update(covariant-by-class self::_NegativeLengthMap&Object&MapMixin::K% key, covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update, {covariant-by-class () →? self::_NegativeLengthMap&Object&MapMixin::V% ifAbsent = #C2}) → self::_NegativeLengthMap&Object&MapMixin::V% { + if(this.{col::MapMixin::containsKey}(key){(core::Object?) → core::bool}) { + return let final self::_NegativeLengthMap&Object&MapMixin::K% #t14 = key in let final self::_NegativeLengthMap&Object&MapMixin::V% #t15 = update(let self::_NegativeLengthMap&Object&MapMixin::V? #t16 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t16 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t16 : #t16{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V%} in let final void #t17 = this.{col::MapMixin::[]=}(#t14, #t15){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void} in #t15; + } + if(!(ifAbsent == null)) { + return let final self::_NegativeLengthMap&Object&MapMixin::K% #t18 = key in let final self::_NegativeLengthMap&Object&MapMixin::V% #t19 = ifAbsent{() → self::_NegativeLengthMap&Object&MapMixin::V%}(){() → self::_NegativeLengthMap&Object&MapMixin::V%} in let final void #t20 = this.{col::MapMixin::[]=}(#t18, #t19){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void} in #t19; + } + throw new core::ArgumentError::value(key, "key", "Key not in map."); + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ updateAll(covariant-by-class (self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V% update) → void { + { + synthesized core::Iterator :sync-for-iterator = this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + this.{col::MapMixin::[]=}(key, update(key, let self::_NegativeLengthMap&Object&MapMixin::V? #t21 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t21 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t21 : #t21{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void}; + } + } + } + } + get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ entries() → core::Iterable> { + return this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::map}>((self::_NegativeLengthMap&Object&MapMixin::K% key) → core::MapEntry => new core::MapEntry::_(key, let self::_NegativeLengthMap&Object&MapMixin::V? #t22 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t22 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t22 : #t22{self::_NegativeLengthMap&Object&MapMixin::V%})){((self::_NegativeLengthMap&Object&MapMixin::K%) → core::MapEntry) → core::Iterable>}; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ map((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::MapEntry transform) → core::Map { + core::Map result = {}; + { + synthesized core::Iterator :sync-for-iterator = this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + core::MapEntry entry = transform(key, let self::_NegativeLengthMap&Object&MapMixin::V? #t23 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t23 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t23 : #t23{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::MapEntry}; + result.{core::Map::[]=}(entry.{core::MapEntry::key}{self::_NegativeLengthMap&Object&MapMixin::map::K2%}, entry.{core::MapEntry::value}{self::_NegativeLengthMap&Object&MapMixin::map::V2%}){(self::_NegativeLengthMap&Object&MapMixin::map::K2%, self::_NegativeLengthMap&Object&MapMixin::map::V2%) → void}; + } + } + } + return result; + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ addEntries(covariant-by-class core::Iterable> newEntries) → void { + { + synthesized core::Iterator> :sync-for-iterator = newEntries.{core::Iterable::iterator}{core::Iterator>}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + core::MapEntry entry = :sync-for-iterator.{core::Iterator::current}{core::MapEntry}; + { + this.{col::MapMixin::[]=}(entry.{core::MapEntry::key}{self::_NegativeLengthMap&Object&MapMixin::K%}, entry.{core::MapEntry::value}{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → void}; + } + } + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ removeWhere((self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::bool test) → void { + core::List keysToRemove = core::_GrowableList::•(0); + { + synthesized core::Iterator :sync-for-iterator = this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + if(test(key, let self::_NegativeLengthMap&Object&MapMixin::V? #t24 = this.{col::MapMixin::[]}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?} in #t24 == null ?{self::_NegativeLengthMap&Object&MapMixin::V%} #t24 : #t24{self::_NegativeLengthMap&Object&MapMixin::V%}){(self::_NegativeLengthMap&Object&MapMixin::K%, self::_NegativeLengthMap&Object&MapMixin::V%) → core::bool}) + keysToRemove.{core::List::add}(key){(self::_NegativeLengthMap&Object&MapMixin::K%) → void}; + } + } + } + { + synthesized core::Iterator :sync-for-iterator = keysToRemove.{core::Iterable::iterator}{core::Iterator}; + for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { + self::_NegativeLengthMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_NegativeLengthMap&Object&MapMixin::K%}; + { + this.{col::MapMixin::remove}(key){(core::Object?) → self::_NegativeLengthMap&Object&MapMixin::V?}; + } + } + } + } + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ containsKey(core::Object? key) → core::bool + return this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::contains}(key){(core::Object?) → core::bool}; + get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ isEmpty() → core::bool + return this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::isEmpty}{core::bool}; + get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ isNotEmpty() → core::bool + return this.{col::MapMixin::keys}{core::Iterable}.{core::Iterable::isNotEmpty}{core::bool}; + get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ values() → core::Iterable + return new col::_MapBaseValueIterable::•(this); + method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ toString() → core::String + return col::MapBase::mapToString(this); +} +class NegativeLengthMap extends self::_NegativeLengthMap&Object&MapMixin { + final field core::Map _map; + constructor •(core::Map _map) → self::NegativeLengthMap + : self::NegativeLengthMap::_map = _map, super self::_NegativeLengthMap&Object&MapMixin::•() + ; + get length() → core::int + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::length}{core::int}.{core::num::<=}(0){(core::num) → core::bool} ?{core::int} 1.{core::int::unary-}(){() → core::int} : this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::length}{core::int}; + operator [](core::Object? key) → self::NegativeLengthMap::V? + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::[]}(key){(core::Object?) → self::NegativeLengthMap::V?}; + operator []=(covariant-by-class self::NegativeLengthMap::K% key, covariant-by-class self::NegativeLengthMap::V% value) → void { + this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::[]=}(key, value){(self::NegativeLengthMap::K%, self::NegativeLengthMap::V%) → void}; + } + get keys() → core::Iterable + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::keys}{core::Iterable}; + method remove(core::Object? key) → self::NegativeLengthMap::V? + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::remove}(key){(core::Object?) → self::NegativeLengthMap::V?}; + method clear() → void + return this.{self::NegativeLengthMap::_map}{core::Map}.{core::Map::clear}(){() → void}; +} +static method switchList(core::List list) → core::int + return block { + core::int #t25; + final synthesized core::List #0#0 = list; + function ##0#1#initializer() → core::int + return #0#0.{core::List::length}{core::int}; + late final synthesized core::int #0#1 = ##0#1#initializer(){() → core::int}; + #L1: + { + { + if(#0#1.{core::num::>=}(#C8){(core::num) → core::bool}) { + #t25 = 2; + break #L1; + } + } + { + if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C9) { + #t25 = 1; + break #L1; + } + } + { + if(#0#1.{core::num::<=}(#C7){(core::num) → core::bool}) { + #t25 = 0; + break #L1; + } + } + throw new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); + } + } =>#t25; +static method switchMap(core::Map map) → core::int + return block { + core::int #t26; + final synthesized core::Map #0#0 = map; + function ##0#1#initializer() → core::int + return #0#0.{core::Map::length}{core::int}; + late final synthesized core::int #0#1 = ##0#1#initializer(){() → core::int}; + #L2: + { + { + if(#0#1 =={core::num::==}{(core::Object) → core::bool} #C9 && #0#0.{core::Map::containsKey}(#C7){(core::Object?) → core::bool} && (let final core::String? #t27 = #0#0.{core::Map::[]}(#C7){(core::Object?) → core::String?} in true)) { + #t26 = 1; + break #L2; + } + } + { + if(#0#1.{core::num::<=}(#C7){(core::num) → core::bool}) { + #t26 = 0; + break #L2; + } + } + { + if(true) { + #t26 = 2; + break #L2; + } + } + throw new _in::ReachabilityError::•("`null` encountered as case in a switch expression with a non-nullable type."); + } + } =>#t26; +static method main() → dynamic { + self::expect(0, self::switchList(core::_GrowableList::•(0))); + self::expect(1, self::switchList(core::_GrowableList::_literal1(0))); + self::expect(2, self::switchList(core::_GrowableList::_literal2(0, 1))); + self::expect(0, self::switchList(new self::NegativeLengthList::•(core::_GrowableList::•(0)))); + self::expect(1, self::switchList(new self::NegativeLengthList::•(core::_GrowableList::_literal1(0)))); + self::expect(2, self::switchList(new self::NegativeLengthList::•(core::_GrowableList::_literal2(0, 1)))); + self::expect(0, self::switchMap({})); + self::expect(1, self::switchMap({0: ""})); + self::expect(2, self::switchMap({1: ""})); + self::expect(0, self::switchMap(new self::NegativeLengthMap::•({}))); + self::expect(1, self::switchMap(new self::NegativeLengthMap::•({0: ""}))); + self::expect(2, self::switchMap(new self::NegativeLengthMap::•({1: ""}))); +} +static method expect(dynamic expected, dynamic actual) → dynamic { + if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) + throw "Expected ${expected}, actual ${actual}"; +} + +constants { + #C1 = "vm:prefer-inline" + #C2 = null + #C3 = core::pragma {name:#C1, options:#C2} + #C4 = "" + #C5 = true + #C6 = static-tearoff col::ListMixin::_compareAny + #C7 = 0 + #C8 = 2 + #C9 = 1 +} + +Extra constant evaluation status: +Evaluated: InstanceInvocation @ org-dartlang-sdk:///sdk/lib/collection/list.dart:492:12 -> IntConstant(-1) +Evaluated: InstanceInvocation @ org-dartlang-sdk:///sdk/lib/collection/list.dart:500:12 -> IntConstant(-1) +Evaluated: InstanceInvocation @ org-dartlang-sdk:///sdk/lib/collection/list.dart:512:12 -> IntConstant(-1) +Evaluated: InstanceInvocation @ org-dartlang-sdk:///sdk/lib/collection/list.dart:524:12 -> IntConstant(-1) +Evaluated: InstanceInvocation @ org-dartlang-testcase:///negative_length.dart:12:41 -> IntConstant(-1) +Evaluated: InstanceInvocation @ org-dartlang-testcase:///negative_length.dart:30:40 -> IntConstant(-1) +Extra constant evaluation: evaluated: 1415, effectively constant: 6 diff --git a/pkg/kernel/lib/src/ast/patterns.dart b/pkg/kernel/lib/src/ast/patterns.dart index c454508c18e..e0acdccb817 100644 --- a/pkg/kernel/lib/src/ast/patterns.dart +++ b/pkg/kernel/lib/src/ast/patterns.dart @@ -479,8 +479,9 @@ class ListPattern extends Pattern { /// The method used to check the `length` of the list. /// - /// If this pattern has a rest pattern, this is an `operator >=` method. - /// Otherwise this is an `operator ==` method. + /// If this pattern has a rest pattern, this is an `operator >=` method. If + /// this is the empty list pattern, this an `operator <=` method. Otherwise + /// this is an `operator ==` method. /// /// This is set during inference. Procedure get lengthCheckTarget => lengthCheckTargetReference!.asProcedure; @@ -952,8 +953,9 @@ class MapPattern extends Pattern { /// Reference to the method used to check the `length` of the map. /// - /// If this pattern has a rest pattern, this is an `operator >=` method. - /// Otherwise this is an `operator ==` method. + /// If this pattern has a rest pattern, this is an `operator >=` method. If + /// this is the empty map pattern, this an `operator <=` method. Otherwise + /// this is an `operator ==` method. /// /// This is set during inference. Reference? lengthCheckTargetReference; @@ -1009,7 +1011,7 @@ class MapPattern extends Pattern { /// The method used to check the `length` of the map. /// /// If this pattern has a rest pattern, this is an `operator >=` method. - /// Otherwise this is an `operator ==` method. + /// Otherwise this is an `operator <=` method. /// /// This is set during inference. Procedure get lengthCheckTarget => lengthCheckTargetReference!.asProcedure;