From fb5ebf6a09a9d6922cc37bc560dd103019a3bf7d Mon Sep 17 00:00:00 2001 From: Joshua Litt Date: Mon, 4 May 2020 22:05:37 +0000 Subject: [PATCH] [dart2js] Fix and rebase impact test for nnbd. Change-Id: I545f5df00c4e8c1ae6a60ec6a6c4458c5d53db78 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146360 Reviewed-by: Mayank Patke Commit-Queue: Joshua Litt --- pkg/compiler/lib/src/universe/feature.dart | 2 +- tests/compiler/dart2js/impact/data/as.dart | 136 +- tests/compiler/dart2js/impact/data/async.dart | 115 +- .../compiler/dart2js/impact/data/classes.dart | 235 ++- .../dart2js/impact/data/constants/lib.dart | 57 +- .../dart2js/impact/data/constants/main.dart | 50 +- .../dart2js/impact/data/constructors.dart | 48 +- .../impact/data/effectively_final.dart | 109 +- .../dart2js/impact/data/expressions.dart | 901 +++++++++- .../impact/data/extract_type_arguments.dart | 118 +- .../dart2js/impact/data/future_or.dart | 18 +- .../dart2js/impact/data/initializers.dart | 234 ++- .../dart2js/impact/data/injected_cast.dart | 939 +++++++++- .../compiler/dart2js/impact/data/invokes.dart | 686 ++++++- .../dart2js/impact/data/jsinterop.dart | 56 +- .../impact/data/jsinterop_setter1.dart | 113 +- .../impact/data/jsinterop_setter2.dart | 125 +- .../dart2js/impact/data/literals.dart | 28 +- .../compiler/dart2js/impact/data/native.dart | 101 +- .../dart2js/impact/data/promotion.dart | 136 +- .../dart2js/impact/data/runtime_type.dart | 1570 ++++++++++++++++- .../dart2js/impact/data/statements.dart | 150 +- .../compiler/dart2js/impact/impact_test.dart | 8 +- 23 files changed, 5770 insertions(+), 165 deletions(-) diff --git a/pkg/compiler/lib/src/universe/feature.dart b/pkg/compiler/lib/src/universe/feature.dart index 92ded95188d..1cb6aff6874 100644 --- a/pkg/compiler/lib/src/universe/feature.dart +++ b/pkg/compiler/lib/src/universe/feature.dart @@ -218,7 +218,7 @@ class RuntimeTypeUse { case RuntimeTypeUseKind.equals: sb.write('equals:'); sb.write(receiverType); - sb.write('/'); + sb.write('=='); sb.write(argumentType); break; case RuntimeTypeUseKind.unknown: diff --git a/tests/compiler/dart2js/impact/data/as.dart b/tests/compiler/dart2js/impact/data/as.dart index 0efa63a8cdb..b4c3f2def8a 100644 --- a/tests/compiler/dart2js/impact/data/as.dart +++ b/tests/compiler/dart2js/impact/data/as.dart @@ -11,7 +11,7 @@ main() { promoted(null); } -/*member: explicitAs: +/*spec:nnbd-off.member: explicitAs: dynamic=[String.length], static=[ Rti._bind(1), @@ -51,13 +51,56 @@ main() { inst:JSBool, param:String] */ +/*spec:nnbd-sdk.member: explicitAs: + dynamic=[String.length], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:String*] +*/ explicitAs(String i) { i.length; // ignore: unnecessary_cast return i as String; } -/*member: implicitAs: +/*spec:nnbd-off.member: implicitAs: dynamic=[String.length], static=[ Rti._bind(1), @@ -97,6 +140,49 @@ explicitAs(String i) { inst:JSBool, param:String] */ +/*spec:nnbd-sdk.member: implicitAs: + dynamic=[String.length], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:String*] +*/ String implicitAs(String i) { dynamic j = i; i.length; @@ -104,7 +190,7 @@ String implicitAs(String i) { return j; } -/*member: promoted: +/*spec:nnbd-off.member: promoted: dynamic=[String.length], static=[ Rti._bind(1), @@ -145,6 +231,50 @@ String implicitAs(String i) { inst:JSNull, is:String] */ +/*spec:nnbd-sdk.member: promoted: + dynamic=[String.length], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + is:String*] +*/ String promoted(dynamic i) { if (i is! String) return null; i.length; diff --git a/tests/compiler/dart2js/impact/data/async.dart b/tests/compiler/dart2js/impact/data/async.dart index af7463f150a..70738c55ede 100644 --- a/tests/compiler/dart2js/impact/data/async.dart +++ b/tests/compiler/dart2js/impact/data/async.dart @@ -219,7 +219,7 @@ testAnonymousAsyncStar() { return () async* {}; } -/*member: testAsyncForIn: +/*spec:nnbd-off.member: testAsyncForIn: dynamic=[ _StreamIterator.cancel(0), _StreamIterator.current, @@ -271,12 +271,67 @@ testAnonymousAsyncStar() { inst:JSNull, inst:Null] */ +/*spec:nnbd-sdk.member: testAsyncForIn: + dynamic=[ + _StreamIterator.cancel(0), + _StreamIterator.current, + _StreamIterator.moveNext(0)], + static=[ + Rti._bind(1), + Rti._eval(1), + StreamIterator.(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _asyncAwait(2), + _asyncRethrow(2), + _asyncReturn(2), + _asyncStartSync(2), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + _makeAsyncAwaitCompleter(0), + _wrapJsFunctionForAsync(1), + findType(1), + instanceType(1)], + type=[ + impl:Stream*, + inst:Closure, + inst:JSBool, + inst:JSNull, + inst:Null] +*/ testAsyncForIn(o) async { // ignore: UNUSED_LOCAL_VARIABLE await for (var e in o) {} } -/*member: testAsyncForInTyped: +/*spec:nnbd-off.member: testAsyncForInTyped: dynamic=[ _StreamIterator.cancel(0), _StreamIterator.current, @@ -329,6 +384,62 @@ testAsyncForIn(o) async { inst:JSNull, inst:Null] */ +/*spec:nnbd-sdk.member: testAsyncForInTyped: + dynamic=[ + _StreamIterator.cancel(0), + _StreamIterator.current, + _StreamIterator.moveNext(0)], + static=[ + Rti._bind(1), + Rti._eval(1), + StreamIterator.(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _asyncAwait(2), + _asyncRethrow(2), + _asyncReturn(2), + _asyncStartSync(2), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + _makeAsyncAwaitCompleter(0), + _wrapJsFunctionForAsync(1), + findType(1), + instanceType(1)], + type=[ + impl:Stream*, + impl:int*, + inst:Closure, + inst:JSBool, + inst:JSNull, + inst:Null] +*/ testAsyncForInTyped(o) async { // ignore: UNUSED_LOCAL_VARIABLE await for (int e in o) {} diff --git a/tests/compiler/dart2js/impact/data/classes.dart b/tests/compiler/dart2js/impact/data/classes.dart index 443975a8aca..4e7ab2cf40d 100644 --- a/tests/compiler/dart2js/impact/data/classes.dart +++ b/tests/compiler/dart2js/impact/data/classes.dart @@ -139,7 +139,7 @@ class ForwardingConstructorClass = ForwardingConstructorSuperClass testForwardingConstructor() => new ForwardingConstructorClass(null); class ForwardingConstructorTypedSuperClass { - /*member: ForwardingConstructorTypedSuperClass.: + /*spec:nnbd-off.member: ForwardingConstructorTypedSuperClass.: static=[ Object.(0), Rti._bind(1), @@ -179,6 +179,49 @@ class ForwardingConstructorTypedSuperClass { inst:JSBool, param:int] */ + /*spec:nnbd-sdk.member: ForwardingConstructorTypedSuperClass.: + static=[ + Object.(0), + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:int*] + */ ForwardingConstructorTypedSuperClass(int arg); } @@ -192,7 +235,7 @@ class ForwardingConstructorTypedClass = ForwardingConstructorTypedSuperClass testForwardingConstructorTyped() => new ForwardingConstructorTypedClass(null); class ForwardingConstructorGenericSuperClass { - /*member: ForwardingConstructorGenericSuperClass.: + /*spec:nnbd-off.member: ForwardingConstructorGenericSuperClass.: static=[ Object.(0), Rti._bind(1), @@ -244,6 +287,61 @@ class ForwardingConstructorGenericSuperClass { inst:JSUnmodifiableArray, param:ForwardingConstructorGenericSuperClass.T] */ + /*spec:nnbd-sdk.member: ForwardingConstructorGenericSuperClass.: + static=[ + Object.(0), + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + checkSubtypeOfRuntimeType(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + param:ForwardingConstructorGenericSuperClass.T*] + */ ForwardingConstructorGenericSuperClass(T arg); } @@ -273,7 +371,7 @@ enum Enum { A } */ testEnum() => Enum.A; -/*member: staticGenericMethod: +/*spec:nnbd-off.member: staticGenericMethod: static=[ Rti._bind(1), Rti._eval(1), @@ -326,17 +424,85 @@ testEnum() => Enum.A; param:Object, param:staticGenericMethod.T] */ +/*spec:nnbd-sdk.member: staticGenericMethod: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + checkSubtypeOfRuntimeType(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + inst:List, + param:Object*, + param:staticGenericMethod.T*] +*/ List staticGenericMethod(T arg) => [arg]; -/*member: testStaticGenericMethod: +/*spec:nnbd-off.member: testStaticGenericMethod: static=[staticGenericMethod(1)], type=[inst:JSBool] */ +/*spec:nnbd-sdk.member: testStaticGenericMethod: + static=[staticGenericMethod(1)], + type=[inst:JSBool] +*/ testStaticGenericMethod() { staticGenericMethod(true); } -/*member: testInstanceGenericMethod:dynamic=[exact:GenericClass.genericMethod(1)],static=[GenericClass.generative(0),checkTypeBound(4),throwTypeError(1)],type=[inst:JSBool]*/ +/*spec:nnbd-off.member: testInstanceGenericMethod:dynamic=[exact:GenericClass.genericMethod(1)],static=[GenericClass.generative(0),checkTypeBound(4),throwTypeError(1)],type=[inst:JSBool]*/ +/*spec:nnbd-sdk.member: testInstanceGenericMethod: + dynamic=[exact:GenericClass.genericMethod(1)], + static=[ + GenericClass.generative(0), + checkTypeBound(4), + throwTypeError(1)], + type=[inst:JSBool] +*/ testInstanceGenericMethod() { new GenericClass.generative().genericMethod(false); } @@ -372,7 +538,7 @@ class Class { class GenericClass { const GenericClass.generative(); - /*member: GenericClass.genericMethod: + /*spec:nnbd-off.member: GenericClass.genericMethod: static=[ Rti._bind(1), Rti._eval(1), @@ -426,6 +592,63 @@ class GenericClass { param:Object, param:genericMethod.T] */ + /*spec:nnbd-sdk.member: GenericClass.genericMethod: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + checkSubtypeOfRuntimeType(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + inst:Map, + param:Object*, + param:genericMethod.T*] + */ Map genericMethod(T arg) => {null: arg}; } diff --git a/tests/compiler/dart2js/impact/data/constants/lib.dart b/tests/compiler/dart2js/impact/data/constants/lib.dart index 47c57604cc1..964ffcb5fd2 100644 --- a/tests/compiler/dart2js/impact/data/constants/lib.dart +++ b/tests/compiler/dart2js/impact/data/constants/lib.dart @@ -44,7 +44,7 @@ const instanceConstantField = const Class(true, false); const typeLiteralField = String; -/*member: id: +/*spec:nnbd-off.member: id: static=[ Rti._bind(1), Rti._eval(1), @@ -96,6 +96,61 @@ const typeLiteralField = String; param:Object, param:id.T] */ +/*spec:nnbd-sdk.member: id: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + checkSubtypeOfRuntimeType(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + param:Object*, + param:id.T*] +*/ T id(T t) => t; const int Function(int) _instantiation = id; diff --git a/tests/compiler/dart2js/impact/data/constants/main.dart b/tests/compiler/dart2js/impact/data/constants/main.dart index 1b959de917e..3a80aeebf7b 100644 --- a/tests/compiler/dart2js/impact/data/constants/main.dart +++ b/tests/compiler/dart2js/impact/data/constants/main.dart @@ -7,7 +7,7 @@ import 'lib.dart'; import 'lib.dart' deferred as defer; -/*member: main:static=**/ +/*member: main:static=%*/ main() { nullLiteral(); boolLiteral(); @@ -91,7 +91,10 @@ stringLiteral() { /*member: symbolLiteral:static=[Symbol.(1)],type=[inst:Symbol]*/ symbolLiteral() => #foo; -/*member: listLiteral:type=[inst:JSBool,inst:List]*/ +/*spec:nnbd-off.member: listLiteral:type=[inst:JSBool,inst:List]*/ +/*spec:nnbd-sdk.member: listLiteral:type=[ + inst:JSBool, + inst:List]*/ listLiteral() => const [true, false]; /*member: mapLiteral:type=[inst:ConstantMap,inst:ConstantProtoMap,inst:ConstantStringMap,inst:GeneralConstantMap,inst:JSBool]*/ @@ -109,7 +112,16 @@ setLiteral() => const {true, false}; */ instanceConstant() => const Class(true, false); -/*member: typeLiteral:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:String]*/ +/*spec:nnbd-off.member: typeLiteral:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:String]*/ +/*spec:nnbd-sdk.member: typeLiteral: + static=[ + createRuntimeType(1), + typeLiteral(1)], + type=[ + inst:Type, + inst:_Type, + lit:String*] +*/ typeLiteral() { const dynamic local = String; return local; @@ -151,7 +163,10 @@ stringLiteralRef() => stringLiteralField; /*member: symbolLiteralRef:static=[Symbol.(1)],type=[inst:Symbol]*/ symbolLiteralRef() => symbolLiteralField; -/*member: listLiteralRef:type=[inst:JSBool,inst:List]*/ +/*spec:nnbd-off.member: listLiteralRef:type=[inst:JSBool,inst:List]*/ +/*spec:nnbd-sdk.member: listLiteralRef:type=[ + inst:JSBool, + inst:List]*/ listLiteralRef() => listLiteralField; /*member: mapLiteralRef:type=[inst:ConstantMap,inst:ConstantProtoMap,inst:ConstantStringMap,inst:GeneralConstantMap,inst:JSBool]*/ @@ -169,7 +184,16 @@ setLiteralRef() => setLiteralField; */ instanceConstantRef() => instanceConstantField; -/*member: typeLiteralRef:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:String]*/ +/*spec:nnbd-off.member: typeLiteralRef:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:String]*/ +/*spec:nnbd-sdk.member: typeLiteralRef: + static=[ + createRuntimeType(1), + typeLiteral(1)], + type=[ + inst:Type, + inst:_Type, + lit:String*] +*/ typeLiteralRef() => typeLiteralField; /*member: instantiationRef:static=[closureFunctionType(1),id,instantiate1(1),instantiatedGenericFunctionType(2)],type=[inst:Instantiation1]*/ @@ -201,7 +225,10 @@ stringLiteralDeferred() => defer.stringLiteralField; symbolLiteralDeferred() => defer.symbolLiteralField; // TODO(johnniwinther): Should we record that this is deferred? -/*member: listLiteralDeferred:type=[inst:JSBool,inst:List]*/ +/*spec:nnbd-off.member: listLiteralDeferred:type=[inst:JSBool,inst:List]*/ +/*spec:nnbd-sdk.member: listLiteralDeferred:type=[ + inst:JSBool, + inst:List]*/ listLiteralDeferred() => defer.listLiteralField; // TODO(johnniwinther): Should we record that this is deferred? @@ -222,7 +249,16 @@ setLiteralDeferred() => defer.setLiteralField; */ instanceConstantDeferred() => defer.instanceConstantField; -/*member: typeLiteralDeferred:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:String{defer}]*/ +/*spec:nnbd-off.member: typeLiteralDeferred:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:String{defer}]*/ +/*spec:nnbd-sdk.member: typeLiteralDeferred: + static=[ + createRuntimeType(1), + typeLiteral(1)], + type=[ + inst:Type, + inst:_Type, + lit:String*{defer}] +*/ typeLiteralDeferred() => defer.typeLiteralField; /*member: instantiationDeferred:static=[closureFunctionType(1),id{defer},instantiate1(1),instantiatedGenericFunctionType(2)],type=[inst:Instantiation1]*/ diff --git a/tests/compiler/dart2js/impact/data/constructors.dart b/tests/compiler/dart2js/impact/data/constructors.dart index fc068693399..cba8812ce0a 100644 --- a/tests/compiler/dart2js/impact/data/constructors.dart +++ b/tests/compiler/dart2js/impact/data/constructors.dart @@ -111,7 +111,8 @@ testConstRedirectingFactoryInvoke() { const Class.redirect(); } -/*member: testConstRedirectingFactoryInvokeGeneric:type=[const:GenericClass]*/ +/*spec:nnbd-off.member: testConstRedirectingFactoryInvokeGeneric:type=[const:GenericClass]*/ +/*spec:nnbd-sdk.member: testConstRedirectingFactoryInvokeGeneric:type=[const:GenericClass]*/ testConstRedirectingFactoryInvokeGeneric() { const GenericClass.redirect(); } @@ -154,7 +155,7 @@ class GenericClass { /*member: GenericClass.generative:static=[Object.(0)]*/ const GenericClass.generative(); - /*member: GenericClass.fact: + /*spec:nnbd-off.member: GenericClass.fact: static=[ Rti._bind(1), Rti._eval(1), @@ -194,6 +195,49 @@ class GenericClass { inst:JSNull, param:Object] */ + /*spec:nnbd-sdk.member: GenericClass.fact: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Object*] + */ factory GenericClass.fact() => null; const factory GenericClass.redirect() = GenericClass.generative; diff --git a/tests/compiler/dart2js/impact/data/effectively_final.dart b/tests/compiler/dart2js/impact/data/effectively_final.dart index 71b9cc50313..ffb98ea79ff 100644 --- a/tests/compiler/dart2js/impact/data/effectively_final.dart +++ b/tests/compiler/dart2js/impact/data/effectively_final.dart @@ -69,7 +69,7 @@ notEffectivelyFinalList() { /*member: _method1:type=[inst:JSNull]*/ num _method1() => null; -/*member: effectivelyFinalPromoted: +/*spec:nnbd-off.member: effectivelyFinalPromoted: dynamic=[ int.+, num.+], @@ -118,6 +118,58 @@ num _method1() => null; inst:JSUInt32, is:int] */ +/*spec:nnbd-sdk.member: effectivelyFinalPromoted: + dynamic=[ + int.+, + num.+], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + _method1(0), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSDouble, + inst:JSInt, + inst:JSNumber, + inst:JSPositiveInt, + inst:JSUInt31, + inst:JSUInt32, + is:int*] +*/ effectivelyFinalPromoted() { dynamic c = _method1(); c + 0; @@ -129,7 +181,7 @@ effectivelyFinalPromoted() { /*member: _method2:type=[inst:JSNull]*/ String _method2() => null; -/*member: effectivelyFinalPromotedInvalid: +/*spec:nnbd-off.member: effectivelyFinalPromotedInvalid: dynamic=[ String.+, int.+], @@ -179,6 +231,59 @@ String _method2() => null; inst:JSUInt32, is:int] */ +/*spec:nnbd-sdk.member: effectivelyFinalPromotedInvalid: + dynamic=[ + String.+, + int.+], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + _method2(0), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSDouble, + inst:JSInt, + inst:JSNumber, + inst:JSPositiveInt, + inst:JSString, + inst:JSUInt31, + inst:JSUInt32, + is:int*] +*/ effectivelyFinalPromotedInvalid() { dynamic c = _method2(); c + ''; diff --git a/tests/compiler/dart2js/impact/data/expressions.dart b/tests/compiler/dart2js/impact/data/expressions.dart index 513f538057e..153a7bff7da 100644 --- a/tests/compiler/dart2js/impact/data/expressions.dart +++ b/tests/compiler/dart2js/impact/data/expressions.dart @@ -107,7 +107,7 @@ testPreInc(o) => ++o; */ testPreDec(o) => --o; -/*member: testIs: +/*spec:nnbd-off.member: testIs: static=[ Rti._bind(1), Rti._eval(1), @@ -147,9 +147,52 @@ testPreDec(o) => --o; inst:JSNull, is:Class] */ +/*spec:nnbd-sdk.member: testIs: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + is:Class*] +*/ testIs() => null is Class; -/*member: testIsGeneric: +/*spec:nnbd-off.member: testIsGeneric: static=[ Rti._bind(1), Rti._eval(1), @@ -200,9 +243,63 @@ testIs() => null is Class; inst:JSUnmodifiableArray, is:GenericClass] */ +/*spec:nnbd-sdk.member: testIsGeneric: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + is:GenericClass*] +*/ testIsGeneric() => null is GenericClass; -/*member: testIsGenericRaw: +/*spec:nnbd-off.member: testIsGenericRaw: static=[ Rti._bind(1), Rti._eval(1), @@ -242,9 +339,52 @@ testIsGeneric() => null is GenericClass; inst:JSNull, is:GenericClass] */ +/*spec:nnbd-sdk.member: testIsGenericRaw: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + is:GenericClass*] +*/ testIsGenericRaw() => null is GenericClass; -/*member: testIsGenericDynamic: +/*spec:nnbd-off.member: testIsGenericDynamic: static=[ Rti._bind(1), Rti._eval(1), @@ -284,9 +424,52 @@ testIsGenericRaw() => null is GenericClass; inst:JSNull, is:GenericClass] */ +/*spec:nnbd-sdk.member: testIsGenericDynamic: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + is:GenericClass*] +*/ testIsGenericDynamic() => null is GenericClass; -/*member: testIsNot: +/*spec:nnbd-off.member: testIsNot: static=[ Rti._bind(1), Rti._eval(1), @@ -326,9 +509,52 @@ testIsGenericDynamic() => null is GenericClass; inst:JSNull, is:Class] */ +/*spec:nnbd-sdk.member: testIsNot: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + is:Class*] +*/ testIsNot() => null is! Class; -/*member: testIsNotGeneric: +/*spec:nnbd-off.member: testIsNotGeneric: static=[ Rti._bind(1), Rti._eval(1), @@ -379,9 +605,63 @@ testIsNot() => null is! Class; inst:JSUnmodifiableArray, is:GenericClass] */ +/*spec:nnbd-sdk.member: testIsNotGeneric: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + is:GenericClass*] +*/ testIsNotGeneric() => null is! GenericClass; -/*member: testIsNotGenericRaw: +/*spec:nnbd-off.member: testIsNotGenericRaw: static=[ Rti._bind(1), Rti._eval(1), @@ -421,9 +701,52 @@ testIsNotGeneric() => null is! GenericClass; inst:JSNull, is:GenericClass] */ +/*spec:nnbd-sdk.member: testIsNotGenericRaw: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + is:GenericClass*] +*/ testIsNotGenericRaw() => null is! GenericClass; -/*member: testIsNotGenericDynamic: +/*spec:nnbd-off.member: testIsNotGenericDynamic: static=[ Rti._bind(1), Rti._eval(1), @@ -463,9 +786,52 @@ testIsNotGenericRaw() => null is! GenericClass; inst:JSNull, is:GenericClass] */ +/*spec:nnbd-sdk.member: testIsNotGenericDynamic: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + is:GenericClass*] +*/ testIsNotGenericDynamic() => null is! GenericClass; -/*member: testIsTypedef: +/*spec:nnbd-off.member: testIsTypedef: static=[ Rti._bind(1), Rti._eval(1), @@ -516,9 +882,63 @@ testIsNotGenericDynamic() => null is! GenericClass; inst:JSUnmodifiableArray, is:dynamic Function()] */ +/*spec:nnbd-sdk.member: testIsTypedef: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + is:dynamic Function()*] +*/ testIsTypedef() => null is Typedef; -/*member: testIsTypedefGeneric: +/*spec:nnbd-off.member: testIsTypedefGeneric: static=[ Rti._bind(1), Rti._eval(1), @@ -569,9 +989,63 @@ testIsTypedef() => null is Typedef; inst:JSUnmodifiableArray, is:int Function(String)] */ +/*spec:nnbd-sdk.member: testIsTypedefGeneric: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + is:int* Function(String*)*] +*/ testIsTypedefGeneric() => null is GenericTypedef; -/*member: testIsTypedefGenericRaw: +/*spec:nnbd-off.member: testIsTypedefGenericRaw: static=[ Rti._bind(1), Rti._eval(1), @@ -622,9 +1096,63 @@ testIsTypedefGeneric() => null is GenericTypedef; inst:JSUnmodifiableArray, is:dynamic Function(dynamic)] */ +/*spec:nnbd-sdk.member: testIsTypedefGenericRaw: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + is:dynamic Function(dynamic)*] +*/ testIsTypedefGenericRaw() => null is GenericTypedef; -/*member: testIsTypedefGenericDynamic: +/*spec:nnbd-off.member: testIsTypedefGenericDynamic: static=[ Rti._bind(1), Rti._eval(1), @@ -675,9 +1203,63 @@ testIsTypedefGenericRaw() => null is GenericTypedef; inst:JSUnmodifiableArray, is:dynamic Function(dynamic)] */ +/*spec:nnbd-sdk.member: testIsTypedefGenericDynamic: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + is:dynamic Function(dynamic)*] +*/ testIsTypedefGenericDynamic() => null is GenericTypedef; -/*member: testIsTypedefDeep: +/*spec:nnbd-off.member: testIsTypedefDeep: static=[ Rti._bind(1), Rti._eval(1), @@ -728,9 +1310,63 @@ testIsTypedefGenericDynamic() => null is GenericTypedef; inst:JSUnmodifiableArray, is:List] */ +/*spec:nnbd-sdk.member: testIsTypedefDeep: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + is:List*] +*/ testIsTypedefDeep() => null is List>; -/*member: testAs: +/*spec:nnbd-off.member: testAs: static=[ Rti._bind(1), Rti._eval(1), @@ -770,10 +1406,53 @@ testIsTypedefDeep() => null is List>; inst:Closure, inst:JSBool] */ +/*spec:nnbd-sdk.member: testAs: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1), + throwRuntimeError(1)], + type=[ + as:Class*, + inst:Closure, + inst:JSBool] +*/ // ignore: UNNECESSARY_CAST testAs(dynamic o) => o as Class; -/*member: testAsGeneric: +/*spec:nnbd-off.member: testAsGeneric: static=[ Rti._bind(1), Rti._eval(1), @@ -824,10 +1503,64 @@ testAs(dynamic o) => o as Class; inst:JSMutableArray, inst:JSUnmodifiableArray] */ +/*spec:nnbd-sdk.member: testAsGeneric: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2), + throwRuntimeError(1)], + type=[ + as:GenericClass*, + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray] +*/ // ignore: UNNECESSARY_CAST testAsGeneric(dynamic o) => o as GenericClass; -/*member: testAsGenericRaw: +/*spec:nnbd-off.member: testAsGenericRaw: static=[ Rti._bind(1), Rti._eval(1), @@ -867,10 +1600,53 @@ testAsGeneric(dynamic o) => o as GenericClass; inst:Closure, inst:JSBool] */ +/*spec:nnbd-sdk.member: testAsGenericRaw: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1), + throwRuntimeError(1)], + type=[ + as:GenericClass*, + inst:Closure, + inst:JSBool] +*/ // ignore: UNNECESSARY_CAST testAsGenericRaw(dynamic o) => o as GenericClass; -/*member: testAsGenericDynamic: +/*spec:nnbd-off.member: testAsGenericDynamic: static=[ Rti._bind(1), Rti._eval(1), @@ -910,6 +1686,49 @@ testAsGenericRaw(dynamic o) => o as GenericClass; inst:Closure, inst:JSBool] */ +/*spec:nnbd-sdk.member: testAsGenericDynamic: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1), + throwRuntimeError(1)], + type=[ + as:GenericClass*, + inst:Closure, + inst:JSBool] +*/ // ignore: UNNECESSARY_CAST testAsGenericDynamic(dynamic o) => o as GenericClass; @@ -921,7 +1740,7 @@ testThrow() => throw ''; /*member: testIfNotNull:dynamic=[Object.==,foo],type=[inst:JSNull]*/ testIfNotNull(o) => o?.foo; -/*member: testTypedIfNotNull: +/*spec:nnbd-off.member: testTypedIfNotNull: dynamic=[ Class.==, Class.field], @@ -964,6 +1783,52 @@ testIfNotNull(o) => o?.foo; inst:JSNull, param:Class] */ +/*spec:nnbd-sdk.member: testTypedIfNotNull: + dynamic=[ + Class.==, + Class.field], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class*] +*/ testTypedIfNotNull(Class o) => o?.field; /*member: testIfNotNullSet:dynamic=[Object.==,foo=],type=[inst:JSBool,inst:JSNull]*/ diff --git a/tests/compiler/dart2js/impact/data/extract_type_arguments.dart b/tests/compiler/dart2js/impact/data/extract_type_arguments.dart index 78bcadf6874..ac1d1719aba 100644 --- a/tests/compiler/dart2js/impact/data/extract_type_arguments.dart +++ b/tests/compiler/dart2js/impact/data/extract_type_arguments.dart @@ -14,7 +14,7 @@ class B {} /*member: C.:static=[Object.(0)]*/ class C implements A, B {} -/*member: testA: +/*spec:nnbd-off.member: testA: dynamic=[call(0)], static=[ Rti._bind(1), @@ -68,9 +68,66 @@ class C implements A, B {} inst:JSUnmodifiableArray, is:A] */ +/*spec:nnbd-sdk.member: testA: + dynamic=[call(0)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + extractTypeArguments*>(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + impl:A*, + impl:Function, + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + is:A] +*/ testA(c, f) => extractTypeArguments(c, f); -/*member: testB: +/*spec:nnbd-off.member: testB: dynamic=[call(0)], static=[ Rti._bind(1), @@ -124,6 +181,63 @@ testA(c, f) => extractTypeArguments(c, f); inst:JSUnmodifiableArray, is:B] */ +/*spec:nnbd-sdk.member: testB: + dynamic=[call(0)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + extractTypeArguments*>(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + impl:B*, + impl:Function, + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + is:B] +*/ testB(c, f) => extractTypeArguments(c, f); /*member: main:static=[C.(0),testA(2),testB(2)],type=[inst:JSNull]*/ diff --git a/tests/compiler/dart2js/impact/data/future_or.dart b/tests/compiler/dart2js/impact/data/future_or.dart index 336fdefacd3..0e51f3874bd 100644 --- a/tests/compiler/dart2js/impact/data/future_or.dart +++ b/tests/compiler/dart2js/impact/data/future_or.dart @@ -6,7 +6,23 @@ import "dart:async"; -/*member: main:dynamic=[runtimeType],runtimeType=[unknown:FutureOr],static=[Future.value(1),checkTypeBound(4),print(1),throwTypeError(1)],type=[inst:JSDouble,inst:JSInt,inst:JSNumber,inst:JSPositiveInt,inst:JSUInt31,inst:JSUInt32]*/ +/*spec:nnbd-off.member: main:dynamic=[runtimeType],runtimeType=[unknown:FutureOr],static=[Future.value(1),checkTypeBound(4),print(1),throwTypeError(1)],type=[inst:JSDouble,inst:JSInt,inst:JSNumber,inst:JSPositiveInt,inst:JSUInt31,inst:JSUInt32]*/ +/*spec:nnbd-sdk.member: main: + dynamic=[runtimeType], + runtimeType=[unknown:FutureOr*], + static=[ + Future.value(1), + checkTypeBound(4), + print(1), + throwTypeError(1)], + type=[ + inst:JSDouble, + inst:JSInt, + inst:JSNumber, + inst:JSPositiveInt, + inst:JSUInt31, + inst:JSUInt32] +*/ @pragma('dart2js:disableFinal') void main() { FutureOr i = new Future.value(0); diff --git a/tests/compiler/dart2js/impact/data/initializers.dart b/tests/compiler/dart2js/impact/data/initializers.dart index 3a7c734aafc..36e9210765a 100644 --- a/tests/compiler/dart2js/impact/data/initializers.dart +++ b/tests/compiler/dart2js/impact/data/initializers.dart @@ -30,7 +30,7 @@ main() { testGenericClass(); } -/*member: testDefaultValuesPositional: +/*spec:nnbd-off.member: testDefaultValuesPositional: static=[ Rti._bind(1), Rti._eval(1), @@ -69,9 +69,51 @@ main() { inst:JSBool, param:bool] */ +/*spec:nnbd-sdk.member: testDefaultValuesPositional: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:bool*] +*/ testDefaultValuesPositional([bool value = false]) {} -/*member: testDefaultValuesNamed: +/*spec:nnbd-off.member: testDefaultValuesNamed: static=[ Rti._bind(1), Rti._eval(1), @@ -110,6 +152,48 @@ testDefaultValuesPositional([bool value = false]) {} inst:JSBool, param:bool] */ +/*spec:nnbd-sdk.member: testDefaultValuesNamed: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:bool*] +*/ testDefaultValuesNamed({bool value: false}) {} class ClassFieldInitializer1 { @@ -162,7 +246,7 @@ testFieldInitializer3() { /*member: ClassInstanceFieldWithInitializer.:static=[Object.(0)]*/ class ClassInstanceFieldWithInitializer { - /*member: ClassInstanceFieldWithInitializer.field: + /*spec:nnbd-off.member: ClassInstanceFieldWithInitializer.field: static=[ Rti._bind(1), Rti._eval(1), @@ -201,6 +285,48 @@ class ClassInstanceFieldWithInitializer { inst:JSBool, param:bool] */ + /*spec:nnbd-sdk.member: ClassInstanceFieldWithInitializer.field: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:bool*] + */ var field = false; } @@ -209,7 +335,7 @@ testInstanceFieldWithInitializer() => new ClassInstanceFieldWithInitializer(); /*member: ClassInstanceFieldTyped.:static=[Object.(0)]*/ class ClassInstanceFieldTyped { - /*member: ClassInstanceFieldTyped.field: + /*spec:nnbd-off.member: ClassInstanceFieldTyped.field: static=[ Rti._bind(1), Rti._eval(1), @@ -249,6 +375,49 @@ class ClassInstanceFieldTyped { inst:JSNull, param:int] */ + /*spec:nnbd-sdk.member: ClassInstanceFieldTyped.field: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:int*] + */ int field; } @@ -275,7 +444,7 @@ class ClassSuperInitializer extends ClassThisInitializer { testSuperInitializer() => new ClassSuperInitializer(); class ClassGeneric { - /*member: ClassGeneric.: + /*spec:nnbd-off.member: ClassGeneric.: static=[ Object.(0), Rti._bind(1), @@ -327,6 +496,61 @@ class ClassGeneric { inst:JSUnmodifiableArray, param:ClassGeneric.T] */ + /*spec:nnbd-sdk.member: ClassGeneric.: + static=[ + Object.(0), + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + checkSubtypeOfRuntimeType(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + param:ClassGeneric.T*] + */ ClassGeneric(T arg); } diff --git a/tests/compiler/dart2js/impact/data/injected_cast.dart b/tests/compiler/dart2js/impact/data/injected_cast.dart index 3ebf374010e..6c2a678346f 100644 --- a/tests/compiler/dart2js/impact/data/injected_cast.dart +++ b/tests/compiler/dart2js/impact/data/injected_cast.dart @@ -16,7 +16,7 @@ class E {} /*member: Class1.:static=[Object.(0)]*/ class Class1 { - /*member: Class1.field1: + /*spec:nnbd-off.member: Class1.field1: static=[ Rti._bind(1), Rti._eval(1), @@ -56,10 +56,53 @@ class Class1 { inst:JSNull, param:A] */ + /*spec:nnbd-sdk.member: Class1.field1: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:A*] + */ A field1; } -/*member: method1: +/*spec:nnbd-off.member: method1: dynamic=[Class1.field1=], static=[ Rti._bind(1), @@ -100,6 +143,50 @@ class Class1 { inst:JSBool, is:Class1] */ +/*spec:nnbd-sdk.member: method1: + dynamic=[Class1.field1=], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + impl:A*, + inst:Closure, + inst:JSBool, + is:Class1*] +*/ method1(dynamic o, dynamic value) { if (o is! Class1) return; o.field1 = value; @@ -107,21 +194,131 @@ method1(dynamic o, dynamic value) { /*member: Class2.:static=[Object.(0)]*/ class Class2 { - /*member: Class2.field2: - static=*, - type=[inst:*,param:Class2.T] + /*spec:nnbd-off.member: Class2.field2: + static=%, + type=[inst:%,param:Class2.T] */ + /*spec:nnbd-sdk.member: Class2.field2: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + checkSubtypeOfRuntimeType(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:Class2.T*] + */ T field2; } -/*member: method2: +/*spec:nnbd-off.member: method2: dynamic=[Class2.field2=], - static=*, + static=%, type=[ impl:A, - inst:*, + inst:%, is:Class2] */ +/*spec:nnbd-sdk.member: method2: + dynamic=[Class2.field2=], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + impl:A*, + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + is:Class2*] +*/ method2(dynamic o, dynamic value) { if (o is! Class2) return; o.field2 = value; @@ -129,7 +326,7 @@ method2(dynamic o, dynamic value) { /*member: Class3.:static=[Object.(0)]*/ class Class3 { - /*member: Class3.method3: + /*spec:nnbd-off.member: Class3.method3: static=[ Rti._bind(1), Rti._eval(1), @@ -171,10 +368,55 @@ class Class3 { param:B, param:C] */ + /*spec:nnbd-sdk.member: Class3.method3: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:A*, + param:B*, + param:C*] + */ method3(A a, [B b, C c]) {} } -/*member: method3: +/*spec:nnbd-off.member: method3: dynamic=[Class3.method3(3)], static=[ Rti._bind(1), @@ -217,6 +459,52 @@ class Class3 { is:Class3, param:B] */ +/*spec:nnbd-sdk.member: method3: + dynamic=[Class3.method3(3)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + impl:A*, + impl:C*, + inst:Closure, + inst:JSBool, + is:Class3*, + param:B*] +*/ method3(dynamic o, dynamic a, B b, dynamic c) { if (o is! Class3) return; o.method3(a, b, c); @@ -224,7 +512,7 @@ method3(dynamic o, dynamic a, B b, dynamic c) { /*member: Class4.:static=[Object.(0)]*/ class Class4 { - /*member: Class4.method4: + /*spec:nnbd-off.member: Class4.method4: static=[ Rti._bind(1), Rti._eval(1), @@ -266,10 +554,55 @@ class Class4 { param:B, param:C] */ + /*spec:nnbd-sdk.member: Class4.method4: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:A*, + param:B*, + param:C*] + */ method4(A a, {B b, C c}) {} } -/*member: method4: +/*spec:nnbd-off.member: method4: dynamic=[Class4.method4(1,b,c)], static=[ Rti._bind(1), @@ -312,6 +645,52 @@ class Class4 { is:Class4, param:B] */ +/*spec:nnbd-sdk.member: method4: + dynamic=[Class4.method4(1,b,c)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + impl:A*, + impl:C*, + inst:Closure, + inst:JSBool, + is:Class4*, + param:B*] +*/ method4(dynamic o, dynamic a, B b, dynamic c) { if (o is! Class4) return; o.method4(a, c: c, b: b); @@ -319,10 +698,10 @@ method4(dynamic o, dynamic a, B b, dynamic c) { /*member: Class5.:static=[Object.(0)]*/ class Class5 { - /*member: Class5.method5: - static=*, + /*spec:nnbd-off.member: Class5.method5: + static=%, type=[ - inst:*, + inst:%, param:C, param:Class5.T1, param:Class5.T2, @@ -330,21 +709,140 @@ class Class5 { param:method5.S1, param:method5.S2] */ + /*spec:nnbd-sdk.member: Class5.method5: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + checkSubtypeOfRuntimeType(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:C*, + param:Class5.T1*, + param:Class5.T2*, + param:Object*, + param:method5.S1*, + param:method5.S2*] + */ method5(T1 a, [T2 b, C c, S1 d, S2 e]) {} } -/*member: method5: +/*spec:nnbd-off.member: method5: dynamic=[Class5.method5(5)], - static=*, + static=%, type=[ impl:A, impl:D, - inst:*, + inst:%, is:Class5, param:B, param:C, param:E] */ +/*spec:nnbd-sdk.member: method5: + dynamic=[Class5.method5(5)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + impl:A*, + impl:D*, + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + is:Class5*, + param:B*, + param:C*, + param:E*] +*/ method5(dynamic o, dynamic a, B b, C c, dynamic d, E e) { if (o is! Class5) return; o.method5(a, b, c, d, e); @@ -352,10 +850,10 @@ method5(dynamic o, dynamic a, B b, C c, dynamic d, E e) { /*member: Class6.:static=[Object.(0)]*/ class Class6 { - /*member: Class6.method6: - static=*, + /*spec:nnbd-off.member: Class6.method6: + static=%, type=[ - inst:*, + inst:%, param:C, param:Class6.T1, param:Class6.T2, @@ -363,21 +861,140 @@ class Class6 { param:method6.S1, param:method6.S2] */ + /*spec:nnbd-sdk.member: Class6.method6: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + checkSubtypeOfRuntimeType(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:C*, + param:Class6.T1*, + param:Class6.T2*, + param:Object*, + param:method6.S1*, + param:method6.S2*] + */ method6(T1 a, {T2 b, C c, S1 d, S2 e}) {} } -/*member: method6: +/*spec:nnbd-off.member: method6: dynamic=[Class6.method6(1,b,c,d,e)], - static=*, + static=%, type=[ impl:A, impl:D, - inst:*, + inst:%, is:Class6, param:B, param:C, param:E] */ +/*spec:nnbd-sdk.member: method6: + dynamic=[Class6.method6(1,b,c,d,e)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + impl:A*, + impl:D*, + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + is:Class6*, + param:B*, + param:C*, + param:E*] +*/ method6(dynamic o, dynamic a, B b, C c, dynamic d, E e) { if (o is! Class6) return; o.method6(a, d: d, b: b, e: e, c: c); @@ -389,7 +1006,7 @@ class Class7 { A Function(A) get f => null; } -/*member: method7: +/*spec:nnbd-off.member: method7: dynamic=[ Class7.f(1), call(1)], @@ -432,6 +1049,52 @@ class Class7 { inst:JSBool, is:Class7] */ +/*spec:nnbd-sdk.member: method7: + dynamic=[ + Class7.f(1), + call(1)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + impl:A*, + inst:Closure, + inst:JSBool, + is:Class7*] +*/ method7(dynamic o, dynamic a) { if (o is! Class7) return; o.f(a); @@ -439,27 +1102,193 @@ method7(dynamic o, dynamic a) { /*member: F.:static=[Object.(0)]*/ class F { - /*member: F.method:static=*,type=[inst:*,param:List]*/ + /*spec:nnbd-off.member: F.method:static=%,type=[inst:%,param:List]*/ + /*spec:nnbd-sdk.member: F.method: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:List*] + */ T method(List list) => null; - /*member: F.field:static=*,type=[inst:*,param:F.T]*/ + /*spec:nnbd-off.member: F.field:static=%,type=[inst:%,param:F.T]*/ + /*spec:nnbd-sdk.member: F.field: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + checkSubtypeOfRuntimeType(2), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:F.T*] + */ T field; } /*member: G.:static=[F.(0)]*/ class G extends F {} -/*member: method8: +/*spec:nnbd-off.member: method8: dynamic=[G.method(1)], - static=*, - type=[impl:List,inst:*,is:G,param:Iterable] + static=%, + type=[impl:List,inst:%,is:G,param:Iterable] +*/ +/*spec:nnbd-sdk.member: method8: + dynamic=[G.method(1)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + impl:List*, + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + is:G*, + param:Iterable*] */ method8(dynamic g, Iterable iterable) { if (g is! G) return null; return g.method(iterable); } -/*member: method9: +/*spec:nnbd-off.member: method9: dynamic=[G.field=], static=[ Rti._bind(1), @@ -502,12 +1331,58 @@ method8(dynamic g, Iterable iterable) { is:G, param:num] */ +/*spec:nnbd-sdk.member: method9: + dynamic=[G.field=], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + impl:int*, + inst:Closure, + inst:JSBool, + inst:JSNull, + is:G*, + param:num*] +*/ method9(dynamic g, num value) { if (g is! G) return null; return g.field = value; } -/*member: main:**/ +/*member: main:%*/ main() { method1(new Class1(), null); method2(new Class2(), null); diff --git a/tests/compiler/dart2js/impact/data/invokes.dart b/tests/compiler/dart2js/impact/data/invokes.dart index 045a41c0d16..3e7d4b4c1ca 100644 --- a/tests/compiler/dart2js/impact/data/invokes.dart +++ b/tests/compiler/dart2js/impact/data/invokes.dart @@ -117,7 +117,7 @@ testTopLevelInvoke() { topLevelFunction3(15, c: 16, b: 17); } -/*member: topLevelFunction1Typed: +/*spec:nnbd-off.member: topLevelFunction1Typed: static=[ Rti._bind(1), Rti._eval(1), @@ -156,9 +156,51 @@ testTopLevelInvoke() { inst:JSBool, param:int] */ +/*spec:nnbd-sdk.member: topLevelFunction1Typed: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:int*] +*/ void topLevelFunction1Typed(int a) {} -/*member: topLevelFunction2Typed: +/*spec:nnbd-off.member: topLevelFunction2Typed: static=[ Rti._bind(1), Rti._eval(1), @@ -200,9 +242,54 @@ void topLevelFunction1Typed(int a) {} param:double, param:num] */ +/*spec:nnbd-sdk.member: topLevelFunction2Typed: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:String*, + param:double*, + param:num*] +*/ int topLevelFunction2Typed(String a, [num b, double c]) => null; -/*member: topLevelFunction3Typed: +/*spec:nnbd-off.member: topLevelFunction3Typed: static=[ Rti._bind(1), Rti._eval(1), @@ -255,11 +342,67 @@ int topLevelFunction2Typed(String a, [num b, double c]) => null; param:Map, param:bool] */ +/*spec:nnbd-sdk.member: topLevelFunction3Typed: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:List*, + param:Map*, + param:bool*] +*/ double topLevelFunction3Typed(bool a, {List b, Map c}) { return null; } -/*member: testTopLevelInvokeTyped: +/*spec:nnbd-off.member: testTopLevelInvokeTyped: static=[ topLevelFunction1Typed(1), topLevelFunction2Typed(1), @@ -283,6 +426,30 @@ double topLevelFunction3Typed(bool a, {List b, Map c}) { inst:List, inst:Map] */ +/*spec:nnbd-sdk.member: testTopLevelInvokeTyped: + static=[ + topLevelFunction1Typed(1), + topLevelFunction2Typed(1), + topLevelFunction2Typed(2), + topLevelFunction2Typed(3), + topLevelFunction3Typed(1), + topLevelFunction3Typed(1,b), + topLevelFunction3Typed(1,b,c), + topLevelFunction3Typed(1,b,c), + topLevelFunction3Typed(1,c)], + type=[ + inst:JSBool, + inst:JSDouble, + inst:JSInt, + inst:JSNull, + inst:JSNumber, + inst:JSPositiveInt, + inst:JSString, + inst:JSUInt31, + inst:JSUInt32, + inst:List, + inst:Map] +*/ testTopLevelInvokeTyped() { topLevelFunction1Typed(0); topLevelFunction2Typed('1'); @@ -295,7 +462,7 @@ testTopLevelInvokeTyped() { topLevelFunction3Typed(false, c: {'16': false}, b: [17]); } -/*member: topLevelFunctionTyped1: +/*spec:nnbd-off.member: topLevelFunctionTyped1: static=[ Rti._bind(1), Rti._eval(1), @@ -345,9 +512,62 @@ testTopLevelInvokeTyped() { inst:JSUnmodifiableArray, param:void Function(num)] */ +/*spec:nnbd-sdk.member: topLevelFunctionTyped1: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + param:void Function(num*)*] +*/ topLevelFunctionTyped1(void a(num b)) {} -/*member: topLevelFunctionTyped2: +/*spec:nnbd-off.member: topLevelFunctionTyped2: static=[ Rti._bind(1), Rti._eval(1), @@ -397,9 +617,62 @@ topLevelFunctionTyped1(void a(num b)) {} inst:JSUnmodifiableArray, param:void Function(num,[String])] */ +/*spec:nnbd-sdk.member: topLevelFunctionTyped2: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + param:void Function(num*,[String*])*] +*/ topLevelFunctionTyped2(void a(num b, [String c])) {} -/*member: topLevelFunctionTyped3: +/*spec:nnbd-off.member: topLevelFunctionTyped3: static=[ Rti._bind(1), Rti._eval(1), @@ -449,9 +722,62 @@ topLevelFunctionTyped2(void a(num b, [String c])) {} inst:JSUnmodifiableArray, param:void Function(num,{String c,int d})] */ +/*spec:nnbd-sdk.member: topLevelFunctionTyped3: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + param:void Function(num*,{String* c,int* d})*] +*/ topLevelFunctionTyped3(void a(num b, {String c, int d})) {} -/*member: topLevelFunctionTyped4: +/*spec:nnbd-off.member: topLevelFunctionTyped4: static=[ Rti._bind(1), Rti._eval(1), @@ -501,6 +827,59 @@ topLevelFunctionTyped3(void a(num b, {String c, int d})) {} inst:JSUnmodifiableArray, param:void Function(num,{int c,String d})] */ +/*spec:nnbd-sdk.member: topLevelFunctionTyped4: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + param:void Function(num*,{int* c,String* d})*] +*/ topLevelFunctionTyped4(void a(num b, {String d, int c})) {} /*member: testTopLevelFunctionTyped: @@ -539,7 +918,7 @@ set topLevelSetter(_) {} /*member: testTopLevelSetterSet:static=[set:topLevelSetter],type=[inst:JSNull]*/ testTopLevelSetterSet() => topLevelSetter = null; -/*member: topLevelSetterTyped=: +/*spec:nnbd-off.member: topLevelSetterTyped=: static=[ Rti._bind(1), Rti._eval(1), @@ -578,6 +957,48 @@ testTopLevelSetterSet() => topLevelSetter = null; inst:JSBool, param:int] */ +/*spec:nnbd-sdk.member: topLevelSetterTyped=: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:int*] +*/ void set topLevelSetterTyped(int value) {} /*member: testTopLevelSetterSetTyped:static=[set:topLevelSetterTyped],type=[inst:JSNull]*/ @@ -606,7 +1027,7 @@ final topLevelFieldFinal = topLevelFunction1(null); /*member: testTopLevelFieldFinal:static=[topLevelFieldFinal]*/ testTopLevelFieldFinal() => topLevelFieldFinal; -/*member: topLevelFieldTyped: +/*spec:nnbd-off.member: topLevelFieldTyped: static=[ Rti._bind(1), Rti._eval(1), @@ -646,12 +1067,55 @@ testTopLevelFieldFinal() => topLevelFieldFinal; inst:JSNull, param:int] */ +/*spec:nnbd-sdk.member: topLevelFieldTyped: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:int*] +*/ int topLevelFieldTyped; /*member: testTopLevelFieldTyped:static=[topLevelFieldTyped]*/ testTopLevelFieldTyped() => topLevelFieldTyped; -/*member: topLevelFieldGeneric1: +/*spec:nnbd-off.member: topLevelFieldGeneric1: static=[ Rti._bind(1), Rti._eval(1), @@ -691,12 +1155,55 @@ testTopLevelFieldTyped() => topLevelFieldTyped; inst:JSNull, param:GenericClass] */ +/*spec:nnbd-sdk.member: topLevelFieldGeneric1: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:GenericClass*] +*/ GenericClass topLevelFieldGeneric1; /*member: testTopLevelFieldGeneric1:static=[topLevelFieldGeneric1]*/ testTopLevelFieldGeneric1() => topLevelFieldGeneric1; -/*member: topLevelFieldGeneric2: +/*spec:nnbd-off.member: topLevelFieldGeneric2: static=[ Rti._bind(1), Rti._eval(1), @@ -736,12 +1243,55 @@ testTopLevelFieldGeneric1() => topLevelFieldGeneric1; inst:JSNull, param:GenericClass] */ +/*spec:nnbd-sdk.member: topLevelFieldGeneric2: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:GenericClass*] +*/ GenericClass topLevelFieldGeneric2; /*member: testTopLevelFieldGeneric2:static=[topLevelFieldGeneric2]*/ testTopLevelFieldGeneric2() => topLevelFieldGeneric2; -/*member: topLevelFieldGeneric3: +/*spec:nnbd-off.member: topLevelFieldGeneric3: static=[ Rti._bind(1), Rti._eval(1), @@ -792,6 +1342,60 @@ testTopLevelFieldGeneric2() => topLevelFieldGeneric2; inst:JSUnmodifiableArray, param:GenericClass] */ +/*spec:nnbd-sdk.member: topLevelFieldGeneric3: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:GenericClass*] +*/ GenericClass topLevelFieldGeneric3; /*member: testTopLevelFieldGeneric3:static=[topLevelFieldGeneric3]*/ @@ -916,7 +1520,7 @@ testLocalFunction() { localFunction() {} } -/*member: testLocalFunctionTyped: +/*spec:nnbd-off.member: testLocalFunctionTyped: static=[ Rti._bind(1), Rti._eval(1), @@ -967,6 +1571,60 @@ testLocalFunction() { inst:JSUnmodifiableArray, param:String] */ +/*spec:nnbd-sdk.member: testLocalFunctionTyped: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + computeSignature(3), + def:localFunction, + findType(1), + getRuntimeTypeArguments(3), + getRuntimeTypeInfo(1), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:Function, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:String*] +*/ testLocalFunctionTyped() { // ignore: UNUSED_ELEMENT int localFunction(String a) => null; diff --git a/tests/compiler/dart2js/impact/data/jsinterop.dart b/tests/compiler/dart2js/impact/data/jsinterop.dart index b997a3e52b7..c5581aa8ec3 100644 --- a/tests/compiler/dart2js/impact/data/jsinterop.dart +++ b/tests/compiler/dart2js/impact/data/jsinterop.dart @@ -61,7 +61,7 @@ typedef void Callback(T value); /*member: GenericClass.:static=[JavaScriptObject.(0)]*/ @JS() class GenericClass { - /*member: GenericClass.method: + /*spec:nnbd-off.member: GenericClass.method: static=[ Rti._bind(1), Rti._eval(1), @@ -112,6 +112,60 @@ class GenericClass { inst:JSUnmodifiableArray, param:void Function(GenericClass.T)] */ + /*spec:nnbd-sdk.member: GenericClass.method: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:void Function(GenericClass.T*)*] + */ external GenericClass method([Callback callback]); } diff --git a/tests/compiler/dart2js/impact/data/jsinterop_setter1.dart b/tests/compiler/dart2js/impact/data/jsinterop_setter1.dart index 3f78563f468..d0dfa5c83a1 100644 --- a/tests/compiler/dart2js/impact/data/jsinterop_setter1.dart +++ b/tests/compiler/dart2js/impact/data/jsinterop_setter1.dart @@ -11,7 +11,7 @@ import 'dart:html' show File; import 'package:js/js.dart'; -/*member: foo=: +/*spec:nnbd-off.member: foo=: static=[ Rti._bind(1), Rti._eval(1), @@ -61,10 +61,63 @@ import 'package:js/js.dart'; native:SqlError, param:Function] */ +/*spec:nnbd-sdk.member: foo=: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + native:ApplicationCacheErrorEvent, + native:DomError, + native:DomException, + native:ErrorEvent, + native:MediaError, + native:NavigatorUserMediaError, + native:OverconstrainedError, + native:PositionError, + native:SensorErrorEvent, + native:SpeechRecognitionError, + native:SqlError, + param:Function*] +*/ @JS() external set foo(Function f); -/*member: _doStuff: +/*spec:nnbd-off.member: _doStuff: dynamic=[ File.==, File.name], @@ -111,6 +164,56 @@ external set foo(Function f); param:File, param:String] */ +/*spec:nnbd-sdk.member: _doStuff: + dynamic=[ + File.==, + File.name], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + defineProperty(3), + findType(1), + instanceType(1), + print(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + inst:JSString, + param:File*, + param:String*] +*/ void _doStuff(String name, File file) { if (file == null) { print('OK'); @@ -118,12 +221,16 @@ void _doStuff(String name, File file) { print(file.name); } -/*member: main: +/*spec:nnbd-off.member: main: static=[ _doStuff, allowInterop(1), set:foo] */ +/*spec:nnbd-sdk.member: main:static=[ + _doStuff, + allowInterop(1), + set:foo]*/ void main() { foo = allowInterop(_doStuff); } diff --git a/tests/compiler/dart2js/impact/data/jsinterop_setter2.dart b/tests/compiler/dart2js/impact/data/jsinterop_setter2.dart index 8ece87e8b47..b52a2addf4c 100644 --- a/tests/compiler/dart2js/impact/data/jsinterop_setter2.dart +++ b/tests/compiler/dart2js/impact/data/jsinterop_setter2.dart @@ -11,7 +11,7 @@ import 'dart:html' show File; import 'package:js/js.dart'; -/*member: foo=: +/*spec:nnbd-off.member: foo=: static=[ Rti._bind(1), Rti._eval(1), @@ -73,10 +73,75 @@ import 'package:js/js.dart'; native:SqlError, param:void Function(String,File)] */ +/*spec:nnbd-sdk.member: foo=: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + native:ApplicationCacheErrorEvent, + native:DomError, + native:DomException, + native:ErrorEvent, + native:File, + native:MediaError, + native:NavigatorUserMediaError, + native:OverconstrainedError, + native:PositionError, + native:SensorErrorEvent, + native:SpeechRecognitionError, + native:SqlError, + param:void Function(String*,File*)*] +*/ @JS() external set foo(void Function(String, File) f); -/*member: _doStuff: +/*spec:nnbd-off.member: _doStuff: dynamic=[ File.==, File.name], @@ -123,6 +188,56 @@ external set foo(void Function(String, File) f); param:File, param:String] */ +/*spec:nnbd-sdk.member: _doStuff: + dynamic=[ + File.==, + File.name], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + defineProperty(3), + findType(1), + instanceType(1), + print(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + inst:JSString, + param:File*, + param:String*] +*/ void _doStuff(String name, File file) { if (file == null) { print('OK'); @@ -130,12 +245,16 @@ void _doStuff(String name, File file) { print(file.name); } -/*member: main: +/*spec:nnbd-off.member: main: static=[ _doStuff, allowInterop(1), set:foo] */ +/*spec:nnbd-sdk.member: main:static=[ + _doStuff, + allowInterop(1), + set:foo]*/ void main() { foo = allowInterop(_doStuff); } diff --git a/tests/compiler/dart2js/impact/data/literals.dart b/tests/compiler/dart2js/impact/data/literals.dart index 4edd315903f..9c0bcfa2d07 100644 --- a/tests/compiler/dart2js/impact/data/literals.dart +++ b/tests/compiler/dart2js/impact/data/literals.dart @@ -131,7 +131,16 @@ testComplexConstSymbol() => const Symbol(complexSymbolField); /*member: testIfNullConstSymbol:static=[Symbol.(1)],type=[inst:Symbol]*/ testIfNullConstSymbol() => const Symbol(null ?? 'foo'); -/*member: testTypeLiteral:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:Object]*/ +/*spec:nnbd-off.member: testTypeLiteral:static=[createRuntimeType(1),typeLiteral(1)],type=[inst:Type,inst:_Type,lit:Object]*/ +/*spec:nnbd-sdk.member: testTypeLiteral: + static=[ + createRuntimeType(1), + typeLiteral(1)], + type=[ + inst:Type, + inst:_Type, + lit:Object*] +*/ testTypeLiteral() => Object; /*member: testBoolFromEnvironment:type=[inst:JSBool]*/ @@ -143,13 +152,17 @@ testEmptyListLiteral() => []; /*member: testEmptyListLiteralDynamic:type=[inst:List]*/ testEmptyListLiteralDynamic() => []; -/*member: testEmptyListLiteralTyped:type=[inst:List]*/ +/*spec:nnbd-off.member: testEmptyListLiteralTyped:type=[inst:List]*/ +/*spec:nnbd-sdk.member: testEmptyListLiteralTyped:type=[inst:List]*/ testEmptyListLiteralTyped() => []; /*member: testEmptyListLiteralConstant:type=[inst:List]*/ testEmptyListLiteralConstant() => const []; -/*member: testNonEmptyListLiteral:type=[inst:JSBool,inst:List]*/ +/*spec:nnbd-off.member: testNonEmptyListLiteral:type=[inst:JSBool,inst:List]*/ +/*spec:nnbd-sdk.member: testNonEmptyListLiteral:type=[ + inst:JSBool, + inst:List]*/ testNonEmptyListLiteral() => [true]; /*member: testEmptyMapLiteral:type=[inst:Map]*/ @@ -158,7 +171,8 @@ testEmptyMapLiteral() => {}; /*member: testEmptyMapLiteralDynamic:type=[inst:Map]*/ testEmptyMapLiteralDynamic() => {}; -/*member: testEmptyMapLiteralTyped:type=[inst:Map]*/ +/*spec:nnbd-off.member: testEmptyMapLiteralTyped:type=[inst:Map]*/ +/*spec:nnbd-sdk.member: testEmptyMapLiteralTyped:type=[inst:Map]*/ testEmptyMapLiteralTyped() => {}; /*member: testEmptyMapLiteralConstant: @@ -170,7 +184,11 @@ type=[ */ testEmptyMapLiteralConstant() => const {}; -/*member: testNonEmptyMapLiteral:type=[inst:JSBool,inst:JSNull,inst:Map]*/ +/*spec:nnbd-off.member: testNonEmptyMapLiteral:type=[inst:JSBool,inst:JSNull,inst:Map]*/ +/*spec:nnbd-sdk.member: testNonEmptyMapLiteral:type=[ + inst:JSBool, + inst:JSNull, + inst:Map]*/ testNonEmptyMapLiteral() => {null: true}; class GenericClass { diff --git a/tests/compiler/dart2js/impact/data/native.dart b/tests/compiler/dart2js/impact/data/native.dart index 3909b77e624..a92309571ec 100644 --- a/tests/compiler/dart2js/impact/data/native.dart +++ b/tests/compiler/dart2js/impact/data/native.dart @@ -47,18 +47,18 @@ testNativeMethod() native; testNativeMethodCreates() native; // This will trigger native instantiation and therefore include type use -// `native:X` for all native types. This is truncated to `type=[*]` to avoid +// `native:X` for all native types. This is truncated to `type=[%]` to avoid // dependency on the particular types. If `testNativeMethodReturns` was not // called `testNativeMethodCreates` would instead trigger the native // instantiations, so the blame is a bit arbitrary. -/*member: testNativeMethodReturns:type=[*]*/ +/*member: testNativeMethodReturns:type=[%]*/ @Returns('String|Null|JSArray') // ignore: NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE testNativeMethodReturns() native; @Native("NativeClass") class NativeClass { - /*member: NativeClass.field: + /*spec:nnbd-off.member: NativeClass.field: static=[ Rti._bind(1), Rti._eval(1), @@ -104,6 +104,55 @@ class NativeClass { native:int, param:Object] */ + /*spec:nnbd-sdk.member: NativeClass.field: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + native:JSExtendableArray, + native:Object, + native:String, + native:bool, + native:double, + native:int, + param:Object*] + */ @annotation_Creates_SerializedScriptValue final Object field; @@ -112,7 +161,7 @@ class NativeClass { } } -/*member: testNativeField: +/*spec:nnbd-off.member: testNativeField: dynamic=[NativeClass.field], static=[ Rti._bind(1), @@ -153,4 +202,48 @@ class NativeClass { inst:JSBool, param:NativeClass] */ +/*spec:nnbd-sdk.member: testNativeField: + dynamic=[NativeClass.field], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + defineProperty(3), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:NativeClass*] +*/ testNativeField(NativeClass c) => c.field; diff --git a/tests/compiler/dart2js/impact/data/promotion.dart b/tests/compiler/dart2js/impact/data/promotion.dart index 9341be1562b..fe2a60dfe78 100644 --- a/tests/compiler/dart2js/impact/data/promotion.dart +++ b/tests/compiler/dart2js/impact/data/promotion.dart @@ -39,7 +39,7 @@ main() { dynamicToNoSuchMethodTearOff(null); } -/*member: positiveTyped: +/*spec:nnbd-off.member: positiveTyped: dynamic=[SubClass.method(0)], static=[ Rti._bind(1), @@ -80,11 +80,55 @@ main() { is:SubClass, param:Class] */ +/*spec:nnbd-sdk.member: positiveTyped: + dynamic=[SubClass.method(0)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + is:SubClass*, + param:Class*] +*/ positiveTyped(Class cls) { if (cls is SubClass) cls.method(); } -/*member: positiveDynamic: +/*spec:nnbd-off.member: positiveDynamic: dynamic=[SubClass.method(0)], static=[ Rti._bind(1), @@ -124,11 +168,54 @@ positiveTyped(Class cls) { inst:JSBool, is:SubClass] */ +/*spec:nnbd-sdk.member: positiveDynamic: + dynamic=[SubClass.method(0)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + is:SubClass*] +*/ positiveDynamic(dynamic cls) { if (cls is SubClass) cls.method(); } -/*member: negativeDynamic: +/*spec:nnbd-off.member: negativeDynamic: dynamic=[SubClass.method(0)], static=[ Rti._bind(1), @@ -168,6 +255,49 @@ positiveDynamic(dynamic cls) { inst:JSBool, is:SubClass] */ +/*spec:nnbd-sdk.member: negativeDynamic: + dynamic=[SubClass.method(0)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + is:SubClass*] +*/ negativeDynamic(dynamic cls) { if (cls is! SubClass) return; cls.method(); diff --git a/tests/compiler/dart2js/impact/data/runtime_type.dart b/tests/compiler/dart2js/impact/data/runtime_type.dart index bb1703f8f4f..e9cdb535e9c 100644 --- a/tests/compiler/dart2js/impact/data/runtime_type.dart +++ b/tests/compiler/dart2js/impact/data/runtime_type.dart @@ -6,9 +6,16 @@ /*member: Class1a.:static=[Object.(0)]*/ class Class1a { - /*member: Class1a.==: + /*spec:nnbd-off.member: Class1a.==: dynamic=[this:Class1a.runtimeType,Object.runtimeType,Type.==], - runtimeType=[equals:Class1a/Object] + runtimeType=[equals:Class1a==Object] + */ + /*spec:nnbd-sdk.member: Class1a.==: + dynamic=[ + Object.runtimeType, + Type.==, + this:Class1a.runtimeType], + runtimeType=[equals:Class1a*==Object] */ bool operator ==(other) { return runtimeType == other.runtimeType; @@ -17,9 +24,19 @@ class Class1a { /*member: Class1b.:static=[Class1a.(0)]*/ class Class1b extends Class1a { - /*member: Class1b.==: - dynamic=[this:Class1b.runtimeType,Object.runtimeType,Type.==], - runtimeType=[equals:Object/Class1b] + /*spec:nnbd-off.member: Class1b.==: + dynamic=[ + Object.runtimeType, + Type.==, + this:Class1b.runtimeType], + runtimeType=[equals:Object==Class1b] + */ + /*spec:nnbd-sdk.member: Class1b.==: + dynamic=[ + Object.runtimeType, + Type.==, + this:Class1b.runtimeType], + runtimeType=[equals:Object==Class1b*] */ bool operator ==(other) { return other.runtimeType == runtimeType; @@ -28,9 +45,22 @@ class Class1b extends Class1a { /*member: Class1c.:static=[Object.(0)]*/ class Class1c implements Class1a { - /*member: Class1c.==: - dynamic=[this:Class1c.runtimeType,Object.==,Object.runtimeType,Type.==], - runtimeType=[equals:Class1c/Object], + /*spec:nnbd-off.member: Class1c.==: + dynamic=[ + Object.==, + Object.runtimeType, + Type.==, + this:Class1c.runtimeType], + runtimeType=[equals:Class1c==Object], + type=[inst:JSNull] + */ + /*spec:nnbd-sdk.member: Class1c.==: + dynamic=[ + Object.==, + Object.runtimeType, + Type.==, + this:Class1c.runtimeType], + runtimeType=[equals:Class1c*==Object], type=[inst:JSNull] */ bool operator ==(other) { @@ -40,9 +70,22 @@ class Class1c implements Class1a { /*member: Class1d.:static=[Object.(0)]*/ class Class1d implements Class1a { - /*member: Class1d.==: - dynamic=[this:Class1d.runtimeType,Object.==,Object.runtimeType,Type.==], - runtimeType=[equals:Object/Class1d], + /*spec:nnbd-off.member: Class1d.==: + dynamic=[ + Object.==, + Object.runtimeType, + Type.==, + this:Class1d.runtimeType], + runtimeType=[equals:Object==Class1d], + type=[inst:JSNull] + */ + /*spec:nnbd-sdk.member: Class1d.==: + dynamic=[ + Object.==, + Object.runtimeType, + Type.==, + this:Class1d.runtimeType], + runtimeType=[equals:Object==Class1d*], type=[inst:JSNull] */ bool operator ==(other) { @@ -62,7 +105,7 @@ class Class3 { /*member: Class4.:static=[Object.(0)]*/ class Class4 {} -/*member: toString1: +/*spec:nnbd-off.member: toString1: dynamic=[ Class2.runtimeType, toString(0)], @@ -118,9 +161,68 @@ class Class4 {} inst:JSUnmodifiableArray, param:Class2] */ +/*spec:nnbd-sdk.member: toString1: + dynamic=[ + Class2.runtimeType, + toString(0)], + runtimeType=[string:Class2*], + static=[ + Rti._bind(1), + Rti._eval(1), + S(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSString, + inst:JSUnmodifiableArray, + param:Class2*] +*/ toString1(Class2 c) => '${c.runtimeType}'; -/*member: toString2: +/*spec:nnbd-off.member: toString2: dynamic=[ Class2.==, Class2.runtimeType, @@ -178,9 +280,70 @@ toString1(Class2 c) => '${c.runtimeType}'; inst:JSUnmodifiableArray, param:Class2] */ +/*spec:nnbd-sdk.member: toString2: + dynamic=[ + Class2.==, + Class2.runtimeType, + toString(0)], + runtimeType=[string:Class2*], + static=[ + Rti._bind(1), + Rti._eval(1), + S(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSString, + inst:JSUnmodifiableArray, + param:Class2*] +*/ toString2(Class2 c) => '${c?.runtimeType}'; -/*member: toString3: +/*spec:nnbd-off.member: toString3: dynamic=[ Class2.runtimeType, Type.toString(0)], @@ -234,9 +397,66 @@ toString2(Class2 c) => '${c?.runtimeType}'; inst:JSUnmodifiableArray, param:Class2] */ +/*spec:nnbd-sdk.member: toString3: + dynamic=[ + Class2.runtimeType, + Type.toString(0)], + runtimeType=[string:Class2*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + param:Class2*] +*/ toString3(Class2 c) => c.runtimeType.toString(); -/*member: toString4: +/*spec:nnbd-off.member: toString4: dynamic=[ Class2.runtimeType, Type.==, @@ -292,9 +512,68 @@ toString3(Class2 c) => c.runtimeType.toString(); inst:JSUnmodifiableArray, param:Class2] */ +/*spec:nnbd-sdk.member: toString4: + dynamic=[ + Class2.runtimeType, + Type.==, + Type.toString(0)], + runtimeType=[string:Class2*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:Class2*] +*/ toString4(Class2 c) => c.runtimeType?.toString(); -/*member: toString5: +/*spec:nnbd-off.member: toString5: dynamic=[ Class2.==, Class2.runtimeType, @@ -351,9 +630,69 @@ toString4(Class2 c) => c.runtimeType?.toString(); inst:JSUnmodifiableArray, param:Class2] */ +/*spec:nnbd-sdk.member: toString5: + dynamic=[ + Class2.==, + Class2.runtimeType, + Type.==, + Type.toString(0)], + runtimeType=[string:Class2*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:Class2*] +*/ toString5(Class2 c) => c?.runtimeType?.toString(); -/*member: toString6: +/*spec:nnbd-off.member: toString6: dynamic=[ Class2.==, Class2.runtimeType, @@ -409,9 +748,68 @@ toString5(Class2 c) => c?.runtimeType?.toString(); inst:JSUnmodifiableArray, param:Class2] */ +/*spec:nnbd-sdk.member: toString6: + dynamic=[ + Class2.==, + Class2.runtimeType, + Type.toString(0)], + runtimeType=[string:Class2*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:Class2*] +*/ toString6(Class2 c) => c?.runtimeType.toString(); -/*member: unknown: +/*spec:nnbd-off.member: unknown: dynamic=[Class2.runtimeType], runtimeType=[unknown:Class2], static=[ @@ -463,16 +861,71 @@ toString6(Class2 c) => c?.runtimeType.toString(); inst:JSUnmodifiableArray, param:Class2] */ +/*spec:nnbd-sdk.member: unknown: + dynamic=[Class2.runtimeType], + runtimeType=[unknown:Class2*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSUnmodifiableArray, + param:Class2*] +*/ unknown(Class2 c) => c.runtimeType; -/*member: equals1: +/*spec:nnbd-off.member: equals1: dynamic=[ Class1a.==, Class1a.runtimeType, Class1d.==, Class1d.runtimeType, Type.==], - runtimeType=[equals:Class1a/Class1d], + runtimeType=[equals:Class1a==Class1d], static=[ Rti._bind(1), Rti._eval(1), @@ -524,9 +977,71 @@ unknown(Class2 c) => c.runtimeType; param:Class1a, param:Class1d] */ +/*spec:nnbd-sdk.member: equals1: + dynamic=[ + Class1a.==, + Class1a.runtimeType, + Class1d.==, + Class1d.runtimeType, + Type.==], + runtimeType=[equals:Class1a*==Class1d*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkSubtype(4), + findType(1), + getRuntimeTypeArgument(3), + getRuntimeTypeArgumentIntercepted(4), + getRuntimeTypeInfo(1), + getTypeArgumentByIndex(2), + instanceType(1), + setRuntimeTypeInfo(2)], + type=[ + inst:Closure, + inst:JSArray, + inst:JSBool, + inst:JSExtendableArray, + inst:JSFixedArray, + inst:JSMutableArray, + inst:JSNull, + inst:JSUnmodifiableArray, + param:Class1a*, + param:Class1d*] +*/ equals1(Class1a a, Class1d b) => a?.runtimeType == b?.runtimeType; -/*member: almostEquals1: +/*spec:nnbd-off.member: almostEquals1: dynamic=[ Class3.runtimeType, Type.==], @@ -570,9 +1085,56 @@ equals1(Class1a a, Class1d b) => a?.runtimeType == b?.runtimeType; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals1: + dynamic=[ + Class3.runtimeType, + Type.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostEquals1(Class3 a) => a.runtimeType == null; -/*member: almostEquals2: +/*spec:nnbd-off.member: almostEquals2: dynamic=[ Class3.==, Class3.runtimeType, @@ -617,9 +1179,57 @@ almostEquals1(Class3 a) => a.runtimeType == null; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals2: + dynamic=[ + Class3.==, + Class3.runtimeType, + Type.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostEquals2(Class3 a) => a?.runtimeType == null; -/*member: almostEquals3: +/*spec:nnbd-off.member: almostEquals3: dynamic=[ Class3.runtimeType, Null.==], @@ -663,9 +1273,56 @@ almostEquals2(Class3 a) => a?.runtimeType == null; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals3: + dynamic=[ + Class3.runtimeType, + Null.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostEquals3(Class3 a) => null == a.runtimeType; -/*member: almostEquals4: +/*spec:nnbd-off.member: almostEquals4: dynamic=[ Class3.==, Class3.runtimeType, @@ -710,9 +1367,57 @@ almostEquals3(Class3 a) => null == a.runtimeType; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals4: + dynamic=[ + Class3.==, + Class3.runtimeType, + Null.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostEquals4(Class3 a) => null == a?.runtimeType; -/*member: almostEquals5: +/*spec:nnbd-off.member: almostEquals5: dynamic=[ Class3.field, Class3.runtimeType, @@ -756,9 +1461,56 @@ almostEquals4(Class3 a) => null == a?.runtimeType; inst:JSBool, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals5: + dynamic=[ + Class3.field, + Class3.runtimeType, + Type.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:Class3*] +*/ almostEquals5(Class3 a) => a.runtimeType == a.field; -/*member: almostEquals6: +/*spec:nnbd-off.member: almostEquals6: dynamic=[ Class3.==, Class3.field, @@ -804,9 +1556,58 @@ almostEquals5(Class3 a) => a.runtimeType == a.field; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals6: + dynamic=[ + Class3.==, + Class3.field, + Class3.runtimeType, + Type.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostEquals6(Class3 a) => a?.runtimeType == a.field; -/*member: almostEquals7: +/*spec:nnbd-off.member: almostEquals7: dynamic=[ Class3.==, Class3.field, @@ -852,9 +1653,58 @@ almostEquals6(Class3 a) => a?.runtimeType == a.field; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals7: + dynamic=[ + Class3.==, + Class3.field, + Class3.runtimeType, + Type.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostEquals7(Class3 a) => a.runtimeType == a?.field; -/*member: almostEquals8: +/*spec:nnbd-off.member: almostEquals8: dynamic=[ Class3.==, Class3.field, @@ -900,9 +1750,58 @@ almostEquals7(Class3 a) => a.runtimeType == a?.field; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals8: + dynamic=[ + Class3.==, + Class3.field, + Class3.runtimeType, + Type.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostEquals8(Class3 a) => a?.runtimeType == a?.field; -/*member: almostEquals9: +/*spec:nnbd-off.member: almostEquals9: dynamic=[ Class3.field, Class3.runtimeType, @@ -946,9 +1845,56 @@ almostEquals8(Class3 a) => a?.runtimeType == a?.field; inst:JSBool, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals9: + dynamic=[ + Class3.field, + Class3.runtimeType, + Object.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:Class3*] +*/ almostEquals9(Class3 a) => a.field == a.runtimeType; -/*member: almostEquals10: +/*spec:nnbd-off.member: almostEquals10: dynamic=[ Class3.==, Class3.field, @@ -994,9 +1940,58 @@ almostEquals9(Class3 a) => a.field == a.runtimeType; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals10: + dynamic=[ + Class3.==, + Class3.field, + Class3.runtimeType, + Object.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostEquals10(Class3 a) => a?.field == a.runtimeType; -/*member: almostEquals11: +/*spec:nnbd-off.member: almostEquals11: dynamic=[ Class3.==, Class3.field, @@ -1042,9 +2037,58 @@ almostEquals10(Class3 a) => a?.field == a.runtimeType; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals11: + dynamic=[ + Class3.==, + Class3.field, + Class3.runtimeType, + Object.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostEquals11(Class3 a) => a.field == a?.runtimeType; -/*member: almostEquals12: +/*spec:nnbd-off.member: almostEquals12: dynamic=[ Class3.==, Class3.field, @@ -1090,9 +2134,58 @@ almostEquals11(Class3 a) => a.field == a?.runtimeType; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostEquals12: + dynamic=[ + Class3.==, + Class3.field, + Class3.runtimeType, + Object.==], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostEquals12(Class3 a) => a?.field == a?.runtimeType; -/*member: almostToString1: +/*spec:nnbd-off.member: almostToString1: dynamic=[ Class3.runtimeType, Type.toString], @@ -1135,9 +2228,55 @@ almostEquals12(Class3 a) => a?.field == a?.runtimeType; inst:JSBool, param:Class3] */ +/*spec:nnbd-sdk.member: almostToString1: + dynamic=[ + Class3.runtimeType, + Type.toString], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:Class3*] +*/ almostToString1(Class3 a) => a.runtimeType.toString; -/*member: almostToString2: +/*spec:nnbd-off.member: almostToString2: dynamic=[ Class3.==, Class3.runtimeType, @@ -1183,9 +2322,58 @@ almostToString1(Class3 a) => a.runtimeType.toString; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostToString2: + dynamic=[ + Class3.==, + Class3.runtimeType, + Type.==, + Type.toString], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostToString2(Class3 a) => a?.runtimeType?.toString; -/*member: almostToString3: +/*spec:nnbd-off.member: almostToString3: dynamic=[ Class3.runtimeType, Type.noSuchMethod(1)], @@ -1229,9 +2417,56 @@ almostToString2(Class3 a) => a?.runtimeType?.toString; inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostToString3: + dynamic=[ + Class3.runtimeType, + Type.noSuchMethod(1)], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostToString3(Class3 a) => a.runtimeType.noSuchMethod(null); -/*member: almostToString4: +/*spec:nnbd-off.member: almostToString4: dynamic=[ Class3.==, Class3.runtimeType, @@ -1276,14 +2511,62 @@ almostToString3(Class3 a) => a.runtimeType.noSuchMethod(null); inst:JSNull, param:Class3] */ +/*spec:nnbd-sdk.member: almostToString4: + dynamic=[ + Class3.==, + Class3.runtimeType, + Type.noSuchMethod(1)], + runtimeType=[unknown:Class3*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*] +*/ almostToString4(Class3 a) => a?.runtimeType.noSuchMethod(null); -/*member: notEquals1: +/*spec:nnbd-off.member: notEquals1: dynamic=[ Class3.runtimeType, Class4.runtimeType, Type.==], - runtimeType=[equals:Class3/Class4], + runtimeType=[equals:Class3==Class4], static=[ Rti._bind(1), Rti._eval(1), @@ -1323,15 +2606,63 @@ almostToString4(Class3 a) => a?.runtimeType.noSuchMethod(null); param:Class3, param:Class4] */ +/*spec:nnbd-sdk.member: notEquals1: + dynamic=[ + Class3.runtimeType, + Class4.runtimeType, + Type.==], + runtimeType=[equals:Class3*==Class4*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + param:Class3*, + param:Class4*] +*/ notEquals1(Class3 a, Class4 b) => a.runtimeType != b.runtimeType; -/*member: notEquals2: +/*spec:nnbd-off.member: notEquals2: dynamic=[ Class3.==, Class3.runtimeType, Class4.runtimeType, Type.==], - runtimeType=[equals:Class3/Class4], + runtimeType=[equals:Class3==Class4], static=[ Rti._bind(1), Rti._eval(1), @@ -1372,15 +2703,65 @@ notEquals1(Class3 a, Class4 b) => a.runtimeType != b.runtimeType; param:Class3, param:Class4] */ +/*spec:nnbd-sdk.member: notEquals2: + dynamic=[ + Class3.==, + Class3.runtimeType, + Class4.runtimeType, + Type.==], + runtimeType=[equals:Class3*==Class4*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*, + param:Class4*] +*/ notEquals2(Class3 a, Class4 b) => a?.runtimeType != b.runtimeType; -/*member: notEquals3: +/*spec:nnbd-off.member: notEquals3: dynamic=[ Class3.runtimeType, Class4.==, Class4.runtimeType, Type.==], - runtimeType=[equals:Class3/Class4], + runtimeType=[equals:Class3==Class4], static=[ Rti._bind(1), Rti._eval(1), @@ -1421,16 +2802,66 @@ notEquals2(Class3 a, Class4 b) => a?.runtimeType != b.runtimeType; param:Class3, param:Class4] */ +/*spec:nnbd-sdk.member: notEquals3: + dynamic=[ + Class3.runtimeType, + Class4.==, + Class4.runtimeType, + Type.==], + runtimeType=[equals:Class3*==Class4*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*, + param:Class4*] +*/ notEquals3(Class3 a, Class4 b) => a.runtimeType != b?.runtimeType; -/*member: notEquals4: +/*spec:nnbd-off.member: notEquals4: dynamic=[ Class3.==, Class3.runtimeType, Class4.==, Class4.runtimeType, Type.==], - runtimeType=[equals:Class3/Class4], + runtimeType=[equals:Class3==Class4], static=[ Rti._bind(1), Rti._eval(1), @@ -1471,6 +2902,57 @@ notEquals3(Class3 a, Class4 b) => a.runtimeType != b?.runtimeType; param:Class3, param:Class4] */ +/*spec:nnbd-sdk.member: notEquals4: + dynamic=[ + Class3.==, + Class3.runtimeType, + Class4.==, + Class4.runtimeType, + Type.==], + runtimeType=[equals:Class3*==Class4*], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1)], + type=[ + inst:Closure, + inst:JSBool, + inst:JSNull, + param:Class3*, + param:Class4*] +*/ notEquals4(Class3 a, Class4 b) => a?.runtimeType != b?.runtimeType; /*member: main:dynamic=[exact:Class1a.==],static=[Class1a.(0),Class1b.(0),Class1c.(0),Class1d.(0),Class2.(0),Class3.(0),Class4.(0),almostEquals1(1),almostEquals10(1),almostEquals11(1),almostEquals12(1),almostEquals2(1),almostEquals3(1),almostEquals4(1),almostEquals5(1),almostEquals6(1),almostEquals7(1),almostEquals8(1),almostEquals9(1),almostToString1(1),almostToString2(1),almostToString3(1),almostToString4(1),checkTypeBound(4),equals1(2),notEquals1(2),notEquals2(2),notEquals3(2),notEquals4(2),print(1),throwTypeError(1),toString1(1),toString2(1),toString3(1),toString4(1),toString5(1),toString6(1),unknown(1)]*/ diff --git a/tests/compiler/dart2js/impact/data/statements.dart b/tests/compiler/dart2js/impact/data/statements.dart index 4d94691a9ed..e0ab8fbd29f 100644 --- a/tests/compiler/dart2js/impact/data/statements.dart +++ b/tests/compiler/dart2js/impact/data/statements.dart @@ -67,7 +67,7 @@ testIfThenElse() { return 1; } -/*member: testForIn: +/*spec:nnbd-off.member: testForIn: dynamic=[ Iterator.current, Iterator.iterator, @@ -113,12 +113,61 @@ testIfThenElse() { inst:JSNull, inst:Null] */ +/*spec:nnbd-sdk.member: testForIn: + dynamic=[ + Iterator.current, + Iterator.iterator, + Iterator.moveNext(0)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkConcurrentModificationError(2), + findType(1), + instanceType(1)], + type=[ + impl:Iterable*, + inst:Closure, + inst:JSBool, + inst:JSNull, + inst:Null] +*/ testForIn(o) { // ignore: UNUSED_LOCAL_VARIABLE for (var e in o) {} } -/*member: testForInTyped: +/*spec:nnbd-off.member: testForInTyped: dynamic=[ Iterator.current, Iterator.iterator, @@ -165,6 +214,56 @@ testForIn(o) { inst:JSNull, inst:Null] */ +/*spec:nnbd-sdk.member: testForInTyped: + dynamic=[ + Iterator.current, + Iterator.iterator, + Iterator.moveNext(0)], + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + checkConcurrentModificationError(2), + findType(1), + instanceType(1)], + type=[ + impl:Iterable*, + impl:int*, + inst:Closure, + inst:JSBool, + inst:JSNull, + inst:Null] +*/ testForInTyped(o) { // ignore: UNUSED_LOCAL_VARIABLE for (int e in o) {} @@ -180,7 +279,7 @@ testTryCatch() { try {} catch (e) {} } -/*member: testTryCatchOn: +/*spec:nnbd-off.member: testTryCatchOn: static=[ Rti._bind(1), Rti._eval(1), @@ -222,6 +321,51 @@ testTryCatch() { inst:PlainJavaScriptObject, inst:UnknownJavaScriptObject] */ +/*spec:nnbd-sdk.member: testTryCatchOn: + static=[ + Rti._bind(1), + Rti._eval(1), + _arrayInstanceType(1), + _asBool(1), + _asBoolQ(1), + _asBoolS(1), + _asDouble(1), + _asDoubleQ(1), + _asDoubleS(1), + _asInt(1), + _asIntQ(1), + _asIntS(1), + _asNum(1), + _asNumQ(1), + _asNumS(1), + _asObject(1), + _asString(1), + _asStringQ(1), + _asStringS(1), + _asTop(1), + _generalAsCheckImplementation(1), + _generalIsTestImplementation(1), + _generalNullableAsCheckImplementation(1), + _generalNullableIsTestImplementation(1), + _installSpecializedAsCheck(1), + _installSpecializedIsTest(1), + _instanceType(1), + _isBool(1), + _isInt(1), + _isNum(1), + _isObject(1), + _isString(1), + _isTop(1), + findType(1), + instanceType(1), + unwrapException(1)], + type=[ + catch:String*, + inst:Closure, + inst:JSBool, + inst:PlainJavaScriptObject, + inst:UnknownJavaScriptObject] +*/ testTryCatchOn() { // ignore: UNUSED_CATCH_CLAUSE try {} on String catch (e) {} diff --git a/tests/compiler/dart2js/impact/impact_test.dart b/tests/compiler/dart2js/impact/impact_test.dart index cc8bfc2dd6d..c3ff87bd8c2 100644 --- a/tests/compiler/dart2js/impact/impact_test.dart +++ b/tests/compiler/dart2js/impact/impact_test.dart @@ -46,6 +46,8 @@ class Tags { class ImpactDataComputer extends DataComputer { const ImpactDataComputer(); + static const String wildcard = '%'; + @override void computeMemberData(Compiler compiler, MemberEntity member, Map> actualMap, @@ -55,14 +57,14 @@ class ImpactDataComputer extends DataComputer { ir.Member node = frontendStrategy.elementMap.getMemberNode(member); Features features = new Features(); if (impact.typeUses.length > 50) { - features.addElement(Tags.typeUse, '*'); + features.addElement(Tags.typeUse, wildcard); } else { for (TypeUse use in impact.typeUses) { features.addElement(Tags.typeUse, use.shortText); } } if (impact.staticUses.length > 50) { - features.addElement(Tags.staticUse, '*'); + features.addElement(Tags.staticUse, wildcard); } else { for (StaticUse use in impact.staticUses) { features.addElement(Tags.staticUse, use.shortText); @@ -92,5 +94,5 @@ class ImpactDataComputer extends DataComputer { @override DataInterpreter get dataValidator => - const FeaturesDataInterpreter(wildcard: '*'); + const FeaturesDataInterpreter(wildcard: wildcard); }