| Index: pkg/analyzer/test/src/summary/linker_test.dart
|
| diff --git a/pkg/analyzer/test/src/summary/linker_test.dart b/pkg/analyzer/test/src/summary/linker_test.dart
|
| index 34a89f282c5555e9b9110e449529be24879f6ce3..0ad9f69acc0dba72cb5efe776a4ecf0411c8baca 100644
|
| --- a/pkg/analyzer/test/src/summary/linker_test.dart
|
| +++ b/pkg/analyzer/test/src/summary/linker_test.dart
|
| @@ -641,6 +641,37 @@ class D extends C {
|
| 'int');
|
| }
|
|
|
| + void test_inheritsCovariant_fromBundle() {
|
| + var bundle = createPackageBundle('''
|
| +class X1 {}
|
| +class X2 extends X1 {}
|
| +class A {
|
| + void foo(covariant X1 x) {}
|
| +}
|
| +class B extends A {
|
| + void foo(X2 x) {}
|
| +}
|
| +''', path: '/a.dart');
|
| + addBundle('/a.ds', bundle);
|
| +
|
| + // C.foo.x must inherit covariance from B.foo.x, even though it is
|
| + // resynthesized from the bundle.
|
| + createLinker('''
|
| +import 'a.dart';
|
| +class C extends B {
|
| + void foo(X2 x) {}
|
| +}
|
| +''');
|
| + LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
|
| + library.libraryCycleForLink.ensureLinked();
|
| +
|
| + ClassElementForLink_Class C = library.getContainedName('C');
|
| + expect(C.methods, hasLength(1));
|
| + MethodElementForLink foo = C.methods[0];
|
| + expect(foo.parameters, hasLength(1));
|
| + expect(foo.parameters[0].isCovariant, isTrue);
|
| + }
|
| +
|
| void test_instantiate_param_of_param_to_bounds() {
|
| createLinker('''
|
| class C<T> {}
|
|
|