[dart2js] Remove dependency on package:expect in RTI-need unit tests.

Bug: #48087
Change-Id: I9729abea021945c66671f74805c4878aa04ade2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227903
Reviewed-by: Stephen Adams <sra@google.com>
This commit is contained in:
Mayank Patke 2022-02-01 23:42:25 +00:00 committed by Commit Bot
parent f8ec0f405b
commit 0163ef0d3b
64 changed files with 348 additions and 302 deletions

View file

@ -0,0 +1,10 @@
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// Marks its argument as live and prevents tree-shaking.
///
/// This is more hermetic than using `package:expect` or `print`. This function
/// may need to be updated as optimizations improve.
@pragma('dart2js:noInline')
void makeLive(dynamic x) => x;

View file

@ -6,7 +6,7 @@
// Derived from tests/web_2/generic_type_error_message_test.
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*class: Foo:*/
class Foo<T extends num> {}
@ -30,7 +30,7 @@ main() {
void test(dynamic object, Type type, {bool expectTypeArguments}) {
bool caught = false;
try {
print(type);
makeLive(type);
object as List<String>;
} catch (e) {
String expected = '$type';
@ -38,10 +38,9 @@ void test(dynamic object, Type type, {bool expectTypeArguments}) {
expected = expected.substring(0, expected.indexOf('<'));
}
expected = "'$expected'";
Expect.isTrue(e.toString().contains(expected),
'Expected "$expected" in the message: $e');
makeLive(e.toString().contains(expected));
caught = true;
print(e);
makeLive(e);
}
Expect.isTrue(caught);
makeLive(caught);
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class:direct,explicit=[Class.T*],implicit=[Class.T],needsArgs*/
/*prod.class: Class:needsArgs*/
class Class<T> {
@ -17,7 +19,7 @@ class Class<T> {
// async.errorHandler callback.
list.forEach(
/*needsSignature*/
(x) => print(x));
(x) => makeLive(x));
}
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class:direct,explicit=[Class.T*],implicit=[Class.T],needsArgs*/
class Class<T> {
method() {
@ -12,7 +14,7 @@ class Class<T> {
// arguments on `Class`. See the 'async_foreach.dart' test.
list.forEach(
/*spec.needsSignature*/
(x) => print(x));
(x) => makeLive(x));
}
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
class A {
call(int i) {}
@ -14,6 +14,6 @@ class A {
test(o) => o is Function(int);
main() {
Expect.isFalse(test(new A()));
Expect.isFalse(test(null));
makeLive(test(new A()));
makeLive(test(null));
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*spec.class: A:direct,explicit=[A.T*],needsArgs*/
class A<T> {
@ -15,7 +15,7 @@ class A<T> {
test(o) => o is Function(int);
main() {
Expect.isFalse(test(new A<int>()));
Expect.isFalse(test(new A<String>()));
makeLive(test(new A<int>()));
makeLive(test(new A<String>()));
new A().call(null); // Use .call to ensure it is live.
}

View file

@ -3,13 +3,14 @@
// BSD-style license that can be found in the LICENSE file.
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
// Dart test program for constructors and initializers.
// Check function subtyping for local functions on generic type against generic
// typedefs.
import 'package:expect/expect.dart';
typedef int Foo<T>(T a, [String b]);
typedef int Bar<T>(T a, [String b]);
typedef int Baz<T>(T a, {String b});
@ -27,17 +28,17 @@ class C<T> {
/*needsSignature*/
int baz(bool a, {String b}) => null;
Expect.equals(expectedResult, foo is Foo<T>, 'foo is Foo<$nameOfT>');
Expect.equals(expectedResult, foo is Bar<T>, 'foo is Bar<$nameOfT>');
Expect.isFalse(foo is Baz<T>, 'foo is Baz<$nameOfT>');
Expect.equals(expectedResult, foo is Boz<T>, 'foo is Boz<$nameOfT>');
Expect.isFalse(foo is Biz<T>, 'foo is Biz<$nameOfT>');
makeLive(expectedResult == foo is Foo<T>);
makeLive(expectedResult == foo is Bar<T>);
makeLive(foo is Baz<T>);
makeLive(expectedResult == foo is Boz<T>);
makeLive(foo is Biz<T>);
Expect.isFalse(baz is Foo<T>, 'baz is Foo<$nameOfT>');
Expect.isFalse(baz is Bar<T>, 'baz is Bar<$nameOfT>');
Expect.equals(expectedResult, baz is Baz<T>, 'baz is Baz<$nameOfT>');
Expect.equals(expectedResult, baz is Boz<T>, 'baz is Boz<$nameOfT>');
Expect.isFalse(baz is Biz<T>, 'bar is Biz<$nameOfT>');
makeLive(baz is Foo<T>);
makeLive(baz is Bar<T>);
makeLive(expectedResult == baz is Baz<T>);
makeLive(expectedResult == baz is Boz<T>);
makeLive(baz is Biz<T>);
}
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1a:explicit=[Class1a*]*/
class Class1a {}
@ -41,15 +41,15 @@ class Class4 {}
method10<T extends Class4>() => null;
main() {
/*needsArgs,needsSignature,selectors=[Selector(call, call, arity=0, types=1)]*/
/*spec.needsArgs,selectors=[Selector(call, call, arity=0, types=1)]*/
/*prod.*/
method7<T extends Class1a>() => null;
/*needsArgs,needsSignature,selectors=[Selector(call, call, arity=0, types=1)]*/
/*spec.needsArgs,selectors=[Selector(call, call, arity=0, types=1)]*/
/*prod.*/
method8<T extends Class2a<num>>() => null;
/*needsArgs,needsSignature,selectors=[Selector(call, call, arity=0, types=1)]*/ method9<
T>() =>
null;
/**/ method9<T>() => null;
dynamic f1 = method1;
dynamic f2 = method2;
@ -69,21 +69,13 @@ main() {
f8<Class2b<int>>();
f9<int>();
if (typeAssertionsEnabled) {
Expect.throws(/*needsSignature*/ () => f1<Class2a<num>>());
Expect.throws(/*needsSignature*/ () => f2<Class2b<String>>());
Expect.throws(/*needsSignature*/ () => c3.method4<Class2a<num>>());
Expect.throws(/*needsSignature*/ () => c3.method5<Class2b<String>>());
Expect.throws(/*needsSignature*/ () => f7<Class2a<num>>());
Expect.throws(/*needsSignature*/ () => f8<Class2b<String>>());
} else {
f1<Class2a<num>>();
f2<Class2b<String>>();
c3.method4<Class2a<num>>();
c3.method5<Class2b<String>>();
f7<Class2a<num>>();
f8<Class2b<String>>();
}
makeLive(/**/ () => f1<Class2a<num>>());
makeLive(/**/ () => f2<Class2b<String>>());
makeLive(/**/ () => c3.method4<Class2a<num>>());
makeLive(
/**/ () => c3.method5<Class2b<String>>());
makeLive(/**/ () => f7<Class2a<num>>());
makeLive(/**/ () => f8<Class2b<String>>());
method10();
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*class: A:implicit=[List<A<C*>*>,List<A<C2*>*>]*/
class A<T> {}
@ -27,6 +27,6 @@ class C1 implements C {}
class C2 implements C {}
main() {
Expect.isTrue(new B<List<A<C>>>().method(new List<A1>()));
Expect.isFalse(new B<List<A<C2>>>().method(new List<A1>()));
makeLive(new B<List<A<C>>>().method(new List<A1>()));
makeLive(new B<List<A<C2>>>().method(new List<A1>()));
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import "package:expect/expect.dart";
import 'package:compiler/src/util/testing.dart';
/*class: A:needsArgs*/
@ -36,7 +36,7 @@ class V {}
class W {}
sameType(a, b) => Expect.equals(a.runtimeType, b.runtimeType);
sameType(a, b) => makeLive(a.runtimeType == b.runtimeType);
main() {
A a = new A<U, V, W>();

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import "package:expect/expect.dart";
import 'package:compiler/src/util/testing.dart';
/*class: A:deps=[method2],direct,explicit=[A.T*],needsArgs*/
class A<T> {
@ -36,6 +36,6 @@ method1<T>() {
}
main() {
Expect.isTrue(method1<BB>());
Expect.isFalse(method1<String>());
makeLive(method1<BB>());
makeLive(method1<String>());
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import "package:expect/expect.dart";
import 'package:compiler/src/util/testing.dart';
/*class: A:deps=[B],direct,explicit=[A.T*],needsArgs*/
class A<T> {
@ -32,6 +32,6 @@ method1<T>() {
}
main() {
Expect.isTrue(method1<BB>());
Expect.isFalse(method1<String>());
makeLive(method1<BB>());
makeLive(method1<String>());
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import "package:expect/expect.dart";
import 'package:compiler/src/util/testing.dart';
/*class: A:deps=[method2],direct,explicit=[A.T*],needsArgs*/
class A<T> {
@ -30,6 +30,6 @@ class B<T> implements BB {
}
main() {
Expect.isTrue(new B<BB>().foo());
Expect.isFalse(new B<String>().foo());
makeLive(new B<BB>().foo());
makeLive(new B<String>().foo());
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import "package:expect/expect.dart";
import 'package:compiler/src/util/testing.dart';
/*class: A:deps=[C.method2],direct,explicit=[A.T*],needsArgs*/
class A<T> {
@ -39,6 +39,6 @@ class C {
main() {
var c = new C();
Expect.isTrue(c.method1<BB>());
Expect.isFalse(c.method1<String>());
makeLive(c.method1<BB>());
makeLive(c.method1<String>());
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
T method1a<T>() => null;
T method1b<T>() => null;
@ -20,5 +22,5 @@ main() {
c.method2a();
T Function<T>() f2 = c.method2b;
print(f1.runtimeType == f2.runtimeType);
makeLive(f1.runtimeType == f2.runtimeType);
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
// Test derived from language_2/generic_methods_dynamic_test/05
/*spec.class: global#JSArray:deps=[ArrayIterator,List],explicit=[JSArray,JSArray.E,JSArray<ArrayIterator.E>],implicit=[JSArray.E],indirect,needsArgs*/
@ -11,8 +13,6 @@
/*spec.class: global#List:deps=[C.bar,JSArray.markFixedList],explicit=[List,List<B*>*,List<Object>,List<String>?,List<markFixedList.T>],indirect,needsArgs*/
/*prod.class: global#List:deps=[C.bar],explicit=[List<B*>*],needsArgs*/
import "package:expect/expect.dart";
class A {}
/*spec.class: B:explicit=[List<B*>*],implicit=[B]*/
@ -28,5 +28,5 @@ class C {
main() {
C c = new C();
dynamic x = c.bar<B>(<B>[new B()]);
Expect.isTrue(x is List<B>);
makeLive(x is List<B>);
}

View file

@ -4,9 +4,9 @@
// @dart = 2.7
// Reduced version of generic_methods_dynamic_05a_strong.
import 'package:compiler/src/util/testing.dart';
import "package:expect/expect.dart";
// Reduced version of generic_methods_dynamic_05a_strong.
/*spec.class: A:deps=[C.bar],direct,explicit=[A.T*,A<B*>*,A<bar.T*>*],needsArgs*/
/*prod.class: A:deps=[C.bar],explicit=[A<B*>*],needsArgs*/
@ -30,5 +30,5 @@ main() {
C c = new C();
dynamic x = c.bar<B>(new A<B>(new B()));
Expect.isTrue(x is A<B>);
makeLive(x is A<B>);
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import "package:expect/expect.dart";
import 'package:compiler/src/util/testing.dart';
class A<T> {}
@ -16,10 +16,10 @@ class Indirect<T> {
}
void main() {
Expect.equals(A, new Indirect<A>().type);
Expect.equals(A, new Indirect<A<dynamic>>().type);
Expect.notEquals(A, new Indirect<A<num>>().type);
Expect.equals(B, new Indirect<B>().type);
Expect.equals(B, new Indirect<B<num>>().type);
Expect.notEquals(B, new Indirect<B<int>>().type);
makeLive(A == new Indirect<A>().type);
makeLive(A == new Indirect<A<dynamic>>().type);
makeLive(A == new Indirect<A<num>>().type);
makeLive(B == new Indirect<B>().type);
makeLive(B == new Indirect<B<num>>().type);
makeLive(B == new Indirect<B<int>>().type);
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
method1() {
/*spec.direct,explicit=[local.T*],needsArgs,needsSignature*/
@ -17,5 +17,5 @@ method1() {
test(o) => o is S Function<S>(S);
main() {
Expect.isTrue(test(method1()));
makeLive(test(method1()));
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*spec.class: global#JSArray:deps=[ArrayIterator,List],explicit=[JSArray,JSArray.E,JSArray<ArrayIterator.E>],implicit=[JSArray.E],indirect,needsArgs*/
/*prod.class: global#JSArray:deps=[List],needsArgs*/
@ -13,13 +13,13 @@ import 'package:expect/expect.dart';
/*spec.member: method:implicit=[method.T],indirect,needsArgs*/
/*prod.member: method:needsArgs*/
method<T>() {
return () => <T>[];
return /*spec.*/ () => <T>[];
}
@pragma('dart2js:noInline')
test(o) => o is List<int>;
main() {
Expect.isTrue(test(method<int>().call()));
Expect.isFalse(test(method<String>().call()));
makeLive(test(method<int>().call()));
makeLive(test(method<String>().call()));
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*spec.class: global#LinkedHashMap:deps=[Map],direct,explicit=[LinkedHashMap<LinkedHashMap.K,LinkedHashMap.V>],implicit=[LinkedHashMap.K,LinkedHashMap.V],needsArgs*/
/*prod.class: global#LinkedHashMap:deps=[Map],needsArgs*/
@ -20,6 +20,6 @@ method<T>() {
test(o) => o is Map<int, int>;
main() {
Expect.isTrue(test(method<int>().call()));
Expect.isFalse(test(method<String>().call()));
makeLive(test(method<int>().call()));
makeLive(test(method<String>().call()));
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
class Class1 {
method1() {
@ -94,16 +94,16 @@ method12() {
test(o) => o is num Function(num);
main() {
Expect.isFalse(test(new Class1().method1()));
Expect.isFalse(test(new Class1().method2()));
Expect.isFalse(test(new Class1().method3()));
Expect.isTrue(test(new Class2().method4<num>()));
Expect.isTrue(test(new Class3().method5<num>()));
Expect.isFalse(test(new Class4().method6<num>()));
Expect.isTrue(test(method7<num>()));
Expect.isTrue(test(method8<num>()));
Expect.isFalse(test(method9()));
Expect.isFalse(test(method10()));
Expect.isFalse(test(method11()));
Expect.isFalse(test(method12()));
makeLive(test(new Class1().method1()));
makeLive(test(new Class1().method2()));
makeLive(test(new Class1().method3()));
makeLive(test(new Class2().method4<num>()));
makeLive(test(new Class3().method5<num>()));
makeLive(test(new Class4().method6<num>()));
makeLive(test(method7<num>()));
makeLive(test(method8<num>()));
makeLive(test(method9()));
makeLive(test(method10()));
makeLive(test(method11()));
makeLive(test(method12()));
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
class Class1 {
method1() {
@ -56,10 +56,10 @@ class Class4<T> {
test(o) => o is num Function(num);
main() {
Expect.isTrue(test(new Class1().method1()));
Expect.isFalse(test(new Class1().method2()));
Expect.isFalse(test(new Class1().method3()));
Expect.isTrue(test(new Class2<num>().method4()));
Expect.isTrue(test(new Class3<num>().method5()));
Expect.isFalse(test(new Class4<num>().method6()));
makeLive(test(new Class1().method1()));
makeLive(test(new Class1().method2()));
makeLive(test(new Class1().method3()));
makeLive(test(new Class2<num>().method4()));
makeLive(test(new Class3<num>().method5()));
makeLive(test(new Class4<num>().method6()));
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
class Class1 {
method1() {
@ -118,19 +118,19 @@ num Function(num) method15() {
test(o) => o is num Function(num);
main() {
Expect.isFalse(test(new Class1().method1()));
Expect.isFalse(test(new Class1().method2()));
Expect.isFalse(test(new Class1().method3()));
Expect.isTrue(test(new Class2().method4<num>()));
Expect.isTrue(test(new Class3().method5<num>()));
Expect.isFalse(test(new Class4().method6<num>()));
Expect.isTrue(test(method7<num>()));
Expect.isTrue(test(method8<num>()));
Expect.isFalse(test(method9()));
Expect.isFalse(test(method10()));
Expect.isFalse(test(method11()));
Expect.isFalse(test(method12()));
Expect.isTrue(test(method13()));
Expect.isTrue(test(method14()));
Expect.isTrue(test(method15()));
makeLive(test(new Class1().method1()));
makeLive(test(new Class1().method2()));
makeLive(test(new Class1().method3()));
makeLive(test(new Class2().method4<num>()));
makeLive(test(new Class3().method5<num>()));
makeLive(test(new Class4().method6<num>()));
makeLive(test(method7<num>()));
makeLive(test(method8<num>()));
makeLive(test(method9()));
makeLive(test(method10()));
makeLive(test(method11()));
makeLive(test(method12()));
makeLive(test(method13()));
makeLive(test(method14()));
makeLive(test(method15()));
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
class Class1 {
/*member: Class1.method1:*/
@ -47,13 +47,13 @@ Object method9(num n) => null;
test(o) => o is num Function(num);
main() {
Expect.isTrue(test(new Class1().method1));
Expect.isFalse(test(new Class1().method2));
Expect.isFalse(test(new Class1().method3));
Expect.isTrue(test(new Class2<num>().method4));
Expect.isTrue(test(new Class3<num>().method5));
Expect.isFalse(test(new Class4<num>().method6));
Expect.isTrue(test(method7));
Expect.isFalse(test(method8));
Expect.isFalse(test(method9));
makeLive(test(new Class1().method1));
makeLive(test(new Class1().method2));
makeLive(test(new Class1().method3));
makeLive(test(new Class2<num>().method4));
makeLive(test(new Class3<num>().method5));
makeLive(test(new Class4<num>().method6));
makeLive(test(method7));
makeLive(test(method8));
makeLive(test(method9));
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
class Class1 {
/*member: Class1.method1:*/
@ -47,13 +47,13 @@ test(o) => o is num Function(num);
forceInstantiation(num Function(num) f) => f;
main() {
Expect.isFalse(test(new Class1().method1));
Expect.isFalse(test(new Class1().method2));
Expect.isFalse(test(new Class1().method3));
Expect.isTrue(test(forceInstantiation(new Class2().method4)));
Expect.isTrue(test(forceInstantiation(new Class3().method5)));
Expect.isFalse(test(new Class4().method6));
Expect.isTrue(test(forceInstantiation(method7)));
Expect.isTrue(test(forceInstantiation(method8)));
Expect.isFalse(test(method9));
makeLive(test(new Class1().method1));
makeLive(test(new Class1().method2));
makeLive(test(new Class1().method3));
makeLive(test(forceInstantiation(new Class2().method4)));
makeLive(test(forceInstantiation(new Class3().method5)));
makeLive(test(new Class4().method6));
makeLive(test(forceInstantiation(method7)));
makeLive(test(forceInstantiation(method8)));
makeLive(test(method9));
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
class C {
/*member: C.noSuchMethod:needsArgs,selectors=[Selector(call, call, arity=0, types=2),Selector(call, foo, arity=0, types=2)]*/
noSuchMethod(i) => i.typeArguments;
@ -11,7 +13,7 @@ class C {
@pragma('dart2js:noInline')
test(dynamic x) {
print(x.foo<int, String>());
makeLive(x.foo<int, String>());
}
main() {

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
class C {
/*member: C.noSuchMethod:needsArgs,selectors=[Selector(call, call, arity=0, types=2),Selector(call, foo, arity=0, types=2)]*/
noSuchMethod(i) => i.typeArguments;
@ -16,7 +18,7 @@ class D {
@pragma('dart2js:noInline')
test(dynamic x) {
print(x.foo<int, String>());
makeLive(x.foo<int, String>());
}
main() {

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
class C {
/*member: C.noSuchMethod:*/
noSuchMethod(i) => null;
@ -11,7 +13,7 @@ class C {
@pragma('dart2js:noInline')
test(dynamic x) {
print(x.foo<int, String>());
makeLive(x.foo<int, String>());
}
main() {

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
class Class<T> {
Class();
@ -20,7 +20,7 @@ main() {
/*needsSignature*/
local2(int i, String s) => i;
Expect.isTrue(local1a.runtimeType == local1b.runtimeType);
Expect.isFalse(local1a.runtimeType == local2.runtimeType);
makeLive(local1a.runtimeType == local1b.runtimeType);
makeLive(local1a.runtimeType == local2.runtimeType);
new Class();
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
class Class<T> {
Class();
@ -21,7 +21,7 @@ main() {
/*prod.needsArgs,needsSignature*/
T local2<T>(T t, String s) => t;
Expect.isTrue(local1a.runtimeType == local1b.runtimeType);
Expect.isFalse(local1a.runtimeType == local2.runtimeType);
makeLive(local1a.runtimeType == local1b.runtimeType);
makeLive(local1a.runtimeType == local2.runtimeType);
new Class();
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
String method() => null;
@ -23,9 +23,9 @@ class Class1<T> {
/*needsSignature*/
T local2(T t, String s) => t;
Expect.isTrue(local1a.runtimeType == local1b.runtimeType);
Expect.isFalse(local1a.runtimeType == local2.runtimeType);
Expect.isFalse(local1a.runtimeType == method.runtimeType);
makeLive(local1a.runtimeType == local1b.runtimeType);
makeLive(local1a.runtimeType == local2.runtimeType);
makeLive(local1a.runtimeType == method.runtimeType);
}
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
class Class1<T> {
Class1();
@ -27,7 +27,7 @@ class Class2<T> {
main() {
var c = new Class1<int>();
Expect.isTrue(c.method1a.runtimeType == c.method1b.runtimeType);
Expect.isFalse(c.method1a.runtimeType == c.method2.runtimeType);
makeLive(c.method1a.runtimeType == c.method1b.runtimeType);
makeLive(c.method1a.runtimeType == c.method2.runtimeType);
new Class2<int>();
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1:direct,explicit=[Class1.T*],needsArgs*/
/*prod.class: Class1:needsArgs*/
@ -28,7 +28,7 @@ class Class2<T> {
main() {
var c = new Class1<int>();
Expect.isTrue(c.method1a.runtimeType == c.method1b.runtimeType);
Expect.isFalse(c.method1a.runtimeType == c.method2.runtimeType);
makeLive(c.method1a.runtimeType == c.method1b.runtimeType);
makeLive(c.method1a.runtimeType == c.method2.runtimeType);
new Class2<int>();
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
method1a() => null;
@ -17,7 +17,7 @@ class Class<T> {
}
main() {
Expect.isTrue(method1a.runtimeType == method1b.runtimeType);
Expect.isFalse(method1a.runtimeType == method2.runtimeType);
makeLive(method1a.runtimeType == method1b.runtimeType);
makeLive(method1a.runtimeType == method2.runtimeType);
new Class<int>();
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*member: method1a:*/
T method1a<T>() => null;
@ -20,7 +20,7 @@ class Class<T> {
}
main() {
Expect.isTrue(method1a.runtimeType == method1b.runtimeType);
Expect.isFalse(method1a.runtimeType == method2.runtimeType);
makeLive(method1a.runtimeType == method1b.runtimeType);
makeLive(method1a.runtimeType == method2.runtimeType);
new Class<int>();
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
class Class1<S> {
Class1();
@ -26,7 +26,7 @@ class Class2<T> {
main() {
var c = new Class1<int>();
Expect.isTrue(c.method1a.runtimeType == c.method1b.runtimeType);
Expect.isFalse(c.method1a.runtimeType == c.method2.runtimeType);
makeLive(c.method1a.runtimeType == c.method1b.runtimeType);
makeLive(c.method1a.runtimeType == c.method2.runtimeType);
new Class2<int>();
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
class Class<T> {
Class();
}
@ -15,7 +17,7 @@ main() {
/*spec.needsSignature*/
local2(int i, String s) => i;
print('${local1.runtimeType}');
makeLive('${local1.runtimeType}');
local2(0, '');
new Class();
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
class Class<T> {
Class();
}
@ -15,7 +17,7 @@ main() {
/*spec.needsArgs,needsSignature,selectors=[Selector(call, call, arity=2, types=1)]*/
local2<T>(t, s) => t;
print('${local1.runtimeType}');
makeLive('${local1.runtimeType}');
local2(0, '');
new Class();
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1:needsArgs*/
class Class1<T> {
Class1();
@ -18,6 +20,6 @@ class Class2<T> {
main() {
Class1<int> cls1 = new Class1<int>();
print(cls1.method.runtimeType.toString());
makeLive(cls1.method.runtimeType.toString());
new Class2<int>();
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*class: Class1:*/
class Class1 {
/*member: Class1.:*/
@ -22,6 +24,6 @@ class Class2<T> {
/*member: main:*/
main() {
Class1 cls1 = new Class1();
print(cls1.method.runtimeType.toString());
makeLive(cls1.method.runtimeType.toString());
new Class2<int>();
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
class Class<T> {
Class();
}
@ -13,7 +15,7 @@ method1() {}
method2(int i, String s) => i;
main() {
print('${method1.runtimeType}');
makeLive('${method1.runtimeType}');
method2(0, '');
new Class();
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*class: Class:*/
class Class<T> {
/*member: Class.:*/
@ -18,7 +20,7 @@ method2<T>(t, s) => t;
/*member: main:*/
main() {
print('${method1.runtimeType}');
makeLive('${method1.runtimeType}');
method2(0, '');
new Class();
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*class: Class1a:needsArgs*/
class Class1a<T> {
@ -38,8 +38,8 @@ main() {
Class1a<int> cls1b2 = new Class1b<int>();
Class1c<int> cls1c = new Class1c<int>();
Class2<int> cls2 = new Class2<int>();
Expect.isFalse(cls1a == cls1b1);
Expect.isTrue(cls1b1 == cls1b2);
Expect.isFalse(cls1a == cls1c);
Expect.isFalse(cls1a == cls2);
makeLive(cls1a == cls1b1);
makeLive(cls1b1 == cls1b2);
makeLive(cls1a == cls1c);
makeLive(cls1a == cls2);
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*class: Class1a:needsArgs*/
class Class1a<T> {
@ -38,8 +38,8 @@ main() {
Class1a<int> cls1b2 = new Class1b<int>();
Class1c<int> cls1c = new Class1c<int>();
Class2<int> cls2 = new Class2<int>();
Expect.isFalse(cls1a == cls1b1);
Expect.isTrue(cls1b1 == cls1b2);
Expect.isFalse(cls1a == cls1c);
Expect.isFalse(cls1a == cls2);
makeLive(cls1a == cls1b1);
makeLive(cls1b1 == cls1b2);
makeLive(cls1a == cls1c);
makeLive(cls1a == cls2);
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*class: Class1a:needsArgs*/
class Class1a<T> {
@ -45,8 +45,8 @@ main() {
Class1a<int> cls1b2 = new Class1b<int>();
Class1c<int> cls1c = new Class1c<int>();
Class2<int> cls2 = new Class2<int>();
Expect.isFalse(cls1a == cls1b1);
Expect.isTrue(cls1b1 == cls1b2);
Expect.isFalse(cls1a == cls1c);
Expect.isFalse(cls1a == cls2);
makeLive(cls1a == cls1b1);
makeLive(cls1b1 == cls1b2);
makeLive(cls1a == cls1c);
makeLive(cls1a == cls2);
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*class: Class1a:needsArgs*/
class Class1a<T> {
@ -45,8 +45,8 @@ main() {
Class1a<int> cls1b2 = new Class1b<int>();
Class1c<int> cls1c = new Class1c<int>();
Class2<int> cls2 = new Class2<int>();
Expect.isFalse(cls1a == cls1b1);
Expect.isTrue(cls1b1 == cls1b2);
Expect.isFalse(cls1a == cls1c);
Expect.isFalse(cls1a == cls2);
makeLive(cls1a == cls1b1);
makeLive(cls1b1 == cls1b2);
makeLive(cls1a == cls1c);
makeLive(cls1a == cls2);
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1a:explicit=[Class1a*]*/
class Class1a {
@ -30,8 +30,8 @@ test(Class1a c, Type type) {
}
main() {
Expect.isTrue(test(new Class1a(), Class1a));
Expect.isFalse(test(new Class1b<int>(), Class1a));
Expect.isFalse(test(new Class1c<int>(), Class1a));
makeLive(test(new Class1a(), Class1a));
makeLive(test(new Class1b<int>(), Class1a));
makeLive(test(new Class1c<int>(), Class1a));
new Class2<int>();
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1a:explicit=[Class1a*],needsArgs*/
/*prod.class: Class1a:needsArgs*/
@ -31,8 +31,8 @@ test(Class1a c, Type type) {
}
main() {
Expect.isTrue(test(new Class1a(), Class1a));
Expect.isFalse(test(new Class1b<int>(), Class1a));
Expect.isFalse(test(new Class1c<int>(), Class1a));
makeLive(test(new Class1a(), Class1a));
makeLive(test(new Class1b<int>(), Class1a));
makeLive(test(new Class1c<int>(), Class1a));
new Class2<int>();
}

View file

@ -4,7 +4,7 @@
// @dart = 2.7
import 'package:expect/expect.dart';
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1a:explicit=[Class1a*]*/
class Class1a {
@ -37,8 +37,8 @@ test(Class3 c, Type type) {
}
main() {
Expect.isTrue(test(new Class3<int>(new Class1a()), Class1a));
Expect.isFalse(test(new Class3<int>(new Class1b<int>()), Class1a));
Expect.isFalse(test(new Class3<int>(new Class1c<int>()), Class1a));
makeLive(test(new Class3<int>(new Class1a()), Class1a));
makeLive(test(new Class3<int>(new Class1b<int>()), Class1a));
makeLive(test(new Class3<int>(new Class1c<int>()), Class1a));
new Class2<int>();
}

View file

@ -4,11 +4,13 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*member: global#instantiate1:needsArgs*/
main() {
/*spec.direct,explicit=[id.T*],needsArgs,needsInst=[<int*>],needsSignature*/
T id<T>(T t, String s) => t;
int Function(int, String s) x = id;
print("${x.runtimeType}");
makeLive("${x.runtimeType}");
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*member: global#instantiate1:needsArgs*/
/*spec.member: id:direct,explicit=[id.T*],needsArgs,needsInst=[<int*>]*/
@ -11,5 +13,5 @@ T id<T>(T t, String s) => t;
main() {
int Function(int, String s) x = id;
print("${x.runtimeType}");
makeLive("${x.runtimeType}");
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*member: global#instantiate1:needsArgs*/
class Class {
@ -13,5 +15,5 @@ class Class {
main() {
int Function(int, String s) x = new Class().id;
print("${x.runtimeType}");
makeLive("${x.runtimeType}");
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
class Class1 {
Class1();
}
@ -19,8 +21,8 @@ class Class3<T> implements Class1 {
main() {
Class1 cls1 = new Class1();
print(cls1.runtimeType.toString());
makeLive(cls1.runtimeType.toString());
new Class2<int>();
Class1 cls3 = new Class3<int>();
print(cls3.runtimeType.toString());
makeLive(cls3.runtimeType.toString());
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1:needsArgs*/
class Class1<T> {
Class1();
@ -15,6 +17,6 @@ class Class2<T> {
main() {
Class1<int> cls1 = new Class1<int>();
print('${cls1.runtimeType}');
makeLive('${cls1.runtimeType}');
new Class2<int>();
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1:needsArgs*/
class Class1<T> {
Class1();
@ -15,6 +17,6 @@ class Class2<T> {
main() {
Class1<int> cls1 = new Class1<int>();
print(cls1.runtimeType?.toString());
makeLive(cls1.runtimeType?.toString());
new Class2<int>();
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1:needsArgs*/
class Class1<T> {
Class1();
@ -15,6 +17,6 @@ class Class2<T> {
main() {
Class1<int> cls1 = new Class1<int>();
print(cls1?.runtimeType?.toString());
makeLive(cls1?.runtimeType?.toString());
new Class2<int>();
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1:needsArgs*/
class Class1<T> {
Class1();
@ -15,6 +17,6 @@ class Class2<T> {
main() {
Class1<int> cls1 = new Class1<int>();
print('${cls1?.runtimeType}');
makeLive('${cls1?.runtimeType}');
new Class2<int>();
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
/*spec.class: Class1:needsArgs*/
class Class1<T> {
Class1();
@ -16,7 +18,7 @@ class Class2<T> {
main() {
dynamic cls1 = new Class1<int>();
print('${cls1.runtimeType}');
makeLive('${cls1.runtimeType}');
new Class2<int>();
cls1 = null;
}

View file

@ -4,6 +4,8 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
class Class1 {
Class1();
}
@ -19,8 +21,8 @@ class Class3<T> implements Class1 {
main() {
Class1 cls1 = new Class1();
print(cls1.runtimeType.toString());
makeLive(cls1.runtimeType.toString());
new Class2<int>();
Class1 cls3 = new Class3<int>();
print(cls3.runtimeType.toString());
makeLive(cls3.runtimeType.toString());
}

View file

@ -4,9 +4,9 @@
// @dart = 2.7
// From co19/Language/Types/Function_Types/subtype_named_args_t02.
import 'package:compiler/src/util/testing.dart';
import 'package:expect/expect.dart';
// From co19/Language/Types/Function_Types/subtype_named_args_t02.
/*spec.class: A:explicit=[A*,G<A*,A1*,A1*,A1*>*,dynamic Function({a:A*,b:A1*,c:A1*,d:A1*})*,dynamic Function({a:A*,b:B*,c:C*,d:D*})*,dynamic Function({b:B*,f:dynamic Function({f1:dynamic Function({a:A*,b:B*,c:C*,d:D*})*,f2:dynamic Function({g:G<A*,B*,C*,D*>*,l:List<List<B*>*>*,m:Map<num*,int*>*})*,f3:dynamic Function({v:dynamic,x:dynamic,y:dynamic,z:dynamic})*})*,g:G<A*,B*,C*,D*>*,x:dynamic})*,dynamic Function({f1:dynamic Function({a:A*,b:B*,c:C*,d:D*})*,f2:dynamic Function({g:G<A*,B*,C*,D*>*,l:List<List<B*>*>*,m:Map<num*,int*>*})*,f3:dynamic Function({v:dynamic,x:dynamic,y:dynamic,z:dynamic})*})*,dynamic Function({g:G<A*,A1*,A1*,A1*>*,l:List<List<A1*>*>*,m:Map<num*,num*>*})*,dynamic Function({g:G<A*,B*,C*,D*>*,l:List<List<B*>*>*,m:Map<num*,int*>*})*,dynamic Function({v:dynamic Function({a:A*,b:B*,c:C*,d:D*})*,x:int*,y:bool*,z:List<Map*>*})*,dynamic Function({v:dynamic,x:A*,y:G*,z:dynamic Function({b:B*,f:dynamic Function({f1:dynamic Function({a:A*,b:B*,c:C*,d:D*})*,f2:dynamic Function({g:G<A*,B*,C*,D*>*,l:List<List<B*>*>*,m:Map<num*,int*>*})*,f3:dynamic Function({v:dynamic,x:dynamic,y:dynamic,z:dynamic})*})*,g:G<A*,B*,C*,D*>*,x:dynamic})*})*]*/
/*prod.class: A:explicit=[dynamic Function({a:A*,b:B*,c:C*,d:D*})*,dynamic Function({f1:dynamic Function({a:A*,b:B*,c:C*,d:D*})*,f2:dynamic Function({g:G<A*,B*,C*,D*>*,l:List<List<B*>*>*,m:Map<num*,int*>*})*,f3:dynamic Function({v:dynamic,x:dynamic,y:dynamic,z:dynamic})*})*,dynamic Function({g:G<A*,B*,C*,D*>*,l:List<List<B*>*>*,m:Map<num*,int*>*})*]*/
@ -52,54 +52,54 @@ typedef okWithDynamicFunc_1({A x, G y, mixFunc z, var v});
typedef okWithDynamicFunc_2({int x, bool y, List<Map> z, classesFunc v});
main() {
Expect.isTrue(
makeLive(
/*needsSignature*/
({D a, B b, C c, A d}) {} is classesFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({A a, A b, A c, A d}) {} is classesFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({D a, A1 b, A1 c, A1 d}) {} is classesFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({D a, A2 b, A2 c, A2 d}) {} is classesFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({D a, D b, D c, D d}) {} is classesFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({var a, var b, var c, var d}) {} is classesFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({Object a, Object b, Object c, Object d}) {} is classesFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({Map<num, num> m, List<List<A1>> l, G<A, A1, A1, A1> g}) {}
is genericsFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({Map<int, int> m, List<List<D>> l, G<D, D, D, D> g}) {} is genericsFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({var m, var l, var g}) {} is genericsFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({Object m, Object l, Object g}) {} is genericsFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({A x, G y, mixFunc z, var v}) {} is dynamicFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
({int x, bool y, List<Map> z, classesFunc v}) {} is dynamicFunc);
Expect.isTrue(/*needsSignature*/ (
makeLive(/*needsSignature*/ (
{okWithClassesFunc_1 f1,
okWithGenericsFunc_1 f2,
okWithDynamicFunc_1 f3}) {} is funcFunc);
Expect.isTrue(
makeLive(
/*needsSignature*/
(
{okWithClassesFunc_2 f1,

View file

@ -4,9 +4,9 @@
// @dart = 2.7
// From co19/Language/Types/Function_Types/subtype_named_args_t01.
import 'package:compiler/src/util/testing.dart';
import "package:expect/expect.dart";
// From co19/Language/Types/Function_Types/subtype_named_args_t01.
/*spec.class: A:explicit=[A*,dynamic Function({a:A*})*]*/
class A {}
@ -37,68 +37,68 @@ typedef okWithT1_3({C a});
typedef okWithT1_4({D a});
main() {
Expect.isTrue(/*needsSignature*/ ({A a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({B a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({C a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({D a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({Object a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({var a}) {} is t1);
makeLive(/*needsSignature*/ ({A a}) {} is t1);
makeLive(/*needsSignature*/ ({B a}) {} is t1);
makeLive(/*needsSignature*/ ({C a}) {} is t1);
makeLive(/*needsSignature*/ ({D a}) {} is t1);
makeLive(/*needsSignature*/ ({Object a}) {} is t1);
makeLive(/*needsSignature*/ ({var a}) {} is t1);
Expect.isTrue(/*needsSignature*/ ({A c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({B c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({C c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({D c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({Object c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({var c}) {} is t2);
makeLive(/*needsSignature*/ ({A c}) {} is t2);
makeLive(/*needsSignature*/ ({B c}) {} is t2);
makeLive(/*needsSignature*/ ({C c}) {} is t2);
makeLive(/*needsSignature*/ ({D c}) {} is t2);
makeLive(/*needsSignature*/ ({Object c}) {} is t2);
makeLive(/*needsSignature*/ ({var c}) {} is t2);
Expect.isTrue(/*needsSignature*/ ({num i}) {} is t3);
Expect.isTrue(/*needsSignature*/ ({int i}) {} is t3);
Expect.isTrue(/*needsSignature*/ ({Object i}) {} is t3);
Expect.isTrue(/*needsSignature*/ ({var i}) {} is t3);
makeLive(/*needsSignature*/ ({num i}) {} is t3);
makeLive(/*needsSignature*/ ({int i}) {} is t3);
makeLive(/*needsSignature*/ ({Object i}) {} is t3);
makeLive(/*needsSignature*/ ({var i}) {} is t3);
Expect.isTrue(/*needsSignature*/ ({A v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({B v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({C v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({D v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({Object v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({var v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({num v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({int v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({Map v}) {} is t4);
Expect.isTrue(
makeLive(/*needsSignature*/ ({A v}) {} is t4);
makeLive(/*needsSignature*/ ({B v}) {} is t4);
makeLive(/*needsSignature*/ ({C v}) {} is t4);
makeLive(/*needsSignature*/ ({D v}) {} is t4);
makeLive(/*needsSignature*/ ({Object v}) {} is t4);
makeLive(/*needsSignature*/ ({var v}) {} is t4);
makeLive(/*needsSignature*/ ({num v}) {} is t4);
makeLive(/*needsSignature*/ ({int v}) {} is t4);
makeLive(/*needsSignature*/ ({Map v}) {} is t4);
makeLive(
/*needsSignature*/ ({Map<List<Map<List, List<int>>>, List> v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({List v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({t8 v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({t7 v}) {} is t4);
makeLive(/*needsSignature*/ ({List v}) {} is t4);
makeLive(/*needsSignature*/ ({t8 v}) {} is t4);
makeLive(/*needsSignature*/ ({t7 v}) {} is t4);
Expect.isTrue(/*needsSignature*/ ({Map m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({Map<List, t8> m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({Object m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({var m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({Map<List, List> m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({Map<int, t8> m}) {} is t5);
makeLive(/*needsSignature*/ ({Map m}) {} is t5);
makeLive(/*needsSignature*/ ({Map<List, t8> m}) {} is t5);
makeLive(/*needsSignature*/ ({Object m}) {} is t5);
makeLive(/*needsSignature*/ ({var m}) {} is t5);
makeLive(/*needsSignature*/ ({Map<List, List> m}) {} is t5);
makeLive(/*needsSignature*/ ({Map<int, t8> m}) {} is t5);
Expect.isTrue(/*needsSignature*/ ({Map<num, num> m}) {} is t6);
Expect.isTrue(/*needsSignature*/ ({Map<int, int> m}) {} is t6);
Expect.isTrue(/*needsSignature*/ ({Map m}) {} is t6);
Expect.isTrue(/*needsSignature*/ ({Object m}) {} is t6);
Expect.isTrue(/*needsSignature*/ ({var m}) {} is t6);
makeLive(/*needsSignature*/ ({Map<num, num> m}) {} is t6);
makeLive(/*needsSignature*/ ({Map<int, int> m}) {} is t6);
makeLive(/*needsSignature*/ ({Map m}) {} is t6);
makeLive(/*needsSignature*/ ({Object m}) {} is t6);
makeLive(/*needsSignature*/ ({var m}) {} is t6);
Expect.isTrue(/*needsSignature*/ ({okWithT1_1 f}) {} is t7);
Expect.isTrue(/*needsSignature*/ ({okWithT1_2 f}) {} is t7);
Expect.isTrue(/*needsSignature*/ ({okWithT1_3 f}) {} is t7);
Expect.isTrue(/*needsSignature*/ ({okWithT1_4 f}) {} is t7);
makeLive(/*needsSignature*/ ({okWithT1_1 f}) {} is t7);
makeLive(/*needsSignature*/ ({okWithT1_2 f}) {} is t7);
makeLive(/*needsSignature*/ ({okWithT1_3 f}) {} is t7);
makeLive(/*needsSignature*/ ({okWithT1_4 f}) {} is t7);
Expect.isTrue(/*needsSignature*/ ({A a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({B a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({C a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({D a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({Object a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({var a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({num a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({int a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({Map a}) {} is t8);
Expect.isTrue(
makeLive(/*needsSignature*/ ({A a}) {} is t8);
makeLive(/*needsSignature*/ ({B a}) {} is t8);
makeLive(/*needsSignature*/ ({C a}) {} is t8);
makeLive(/*needsSignature*/ ({D a}) {} is t8);
makeLive(/*needsSignature*/ ({Object a}) {} is t8);
makeLive(/*needsSignature*/ ({var a}) {} is t8);
makeLive(/*needsSignature*/ ({num a}) {} is t8);
makeLive(/*needsSignature*/ ({int a}) {} is t8);
makeLive(/*needsSignature*/ ({Map a}) {} is t8);
makeLive(
/*needsSignature*/ ({Map<List<Map<List, List<int>>>, List> a}) {} is t8);
Expect.isTrue(/*needsSignature*/ ({List a}) {} is t8);
makeLive(/*needsSignature*/ ({List a}) {} is t8);
}

View file

@ -4,11 +4,11 @@
// @dart = 2.7
import 'package:compiler/src/util/testing.dart';
// Test that substitutions are emitted for classes that are only used as
// type arguments.
import 'package:expect/expect.dart';
class K {}
/*class: A:explicit=[X<A<String*>*>*]*/
@ -23,5 +23,5 @@ main() {
var v = new DateTime.now().millisecondsSinceEpoch != 42
? new X<B>()
: new X<A<String>>();
Expect.isFalse(v is X<A<String>>);
makeLive(v is X<A<String>>);
}

View file

@ -4,9 +4,9 @@
// @dart = 2.7
// Based on tests\language_2\type_variable_function_type_test.dart
import 'package:compiler/src/util/testing.dart';
import 'package:expect/expect.dart';
// Based on tests\language_2\type_variable_function_type_test.dart
typedef T Func<T>();
@ -26,6 +26,6 @@ class Bar<T> {
void main() {
dynamic x = new Foo<List<String>>();
if (new DateTime.now().millisecondsSinceEpoch == 42) x = new Foo<int>();
Expect.isFalse(x.m(new Bar<String>().f()));
Expect.isTrue(x.m(new Bar<List<String>>().f()));
makeLive(x.m(new Bar<String>().f()));
makeLive(x.m(new Bar<List<String>>().f()));
}