blob: 3945cdc2f6754c8b876bc14333be9f377f421889 [file] [log] [blame]
// Copyright (c) 2018, 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.
// @dart = 2.7
@JS()
library foo;
/*class: global#LegacyJavaScriptObject:*/
import 'package:compiler/src/util/testing.dart';
import 'package:js/js.dart';
@JS()
@anonymous
/*spec.class: A:checkedInstance,checkedTypeArgument,typeArgument*/
/*prod.class: A:checkedTypeArgument,typeArgument*/
class A<T> {
external factory A();
}
/*class: Class1:checks=[],instance*/
class Class1<T> {
method() {
// This caused and assertion failure in codegen.
test1(new List<A<T>>.from([]));
}
}
/*class: Class2:checks=[],instance*/
class Class2<T> {
method() {
// This caused and assertion failure in codegen.
test2(new List<A<T> Function()>.from([]));
}
}
main() {
new Class1<int>().method();
new Class1<String>().method();
new Class2<int>().method();
new Class2<String>().method();
}
test1(o) {
makeLive(o is List<A<int>>);
makeLive(o is List<A<String>>);
}
test2(o) {
makeLive(o is List<A<int> Function()>);
makeLive(o is List<A<String> Function()>);
}