Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 2653873002: fix #28141, fix super generic method bounds check (Closed)
Patch Set: split loops and merge Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/test/generated/strong_mode_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.src.task.strong.checker_test; 5 library analyzer.test.src.task.strong.checker_test;
6 6
7 import 'package:test_reflective_loader/test_reflective_loader.dart'; 7 import 'package:test_reflective_loader/test_reflective_loader.dart';
8 8
9 import 'strong_test_helper.dart'; 9 import 'strong_test_helper.dart';
10 10
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 class DerivedFuture3<T> extends Future<T> { 2098 class DerivedFuture3<T> extends Future<T> {
2099 /*=S*/ then/*<S>*/(Object onValue(T t)) => null; 2099 /*=S*/ then/*<S>*/(Object onValue(T t)) => null;
2100 } 2100 }
2101 2101
2102 class DerivedFuture4<A> extends Future<A> { 2102 class DerivedFuture4<A> extends Future<A> {
2103 /*=B*/ then/*<B>*/(Object onValue(A a)) => null; 2103 /*=B*/ then/*<B>*/(Object onValue(A a)) => null;
2104 } 2104 }
2105 '''); 2105 ''');
2106 } 2106 }
2107 2107
2108 void test_genericMethodSuper() {
2109 checkFile(r'''
2110 class A<T> {
2111 A<S> create<S extends T>() => new A<S>();
2112 }
2113 class B extends A {
2114 A<S> create<S>() => super.create<S>();
2115 }
2116 class C extends A {
2117 A<S> create<S>() => super.create();
2118 }
2119 class D extends A<num> {
2120 A<S> create<S extends num>() => super.create<S>();
2121 }
2122 class E extends A<num> {
2123 A<S> create<S extends num>() => /*error:RETURN_OF_INVALID_TYPE*/super.create<i nt>();
2124 }
2125 class F extends A<num> {
2126 create2<S>() => super.create</*error:TYPE_ARGUMENT_NOT_MATCHING_BOUNDS*/S>();
2127 }
2128 ''');
2129 }
2130
2131 void test_genericMethodSuperSubstitute() {
2132 checkFile(r'''
2133 class Clonable<T> {}
2134 class G<T> {
2135 create<A extends Clonable<T>, B extends Iterable<A>>() => null;
2136 }
2137 class H extends G<num> {
2138 create2() => super.create<Clonable<int>, List<Clonable<int>>>();
2139 }
2140 ''');
2141 }
2142
2108 void test_getterGetterOverride() { 2143 void test_getterGetterOverride() {
2109 checkFile(''' 2144 checkFile('''
2110 class A {} 2145 class A {}
2111 class B extends A {} 2146 class B extends A {}
2112 class C extends B {} 2147 class C extends B {}
2113 2148
2114 abstract class Base { 2149 abstract class Base {
2115 B get f1; 2150 B get f1;
2116 B get f2; 2151 B get f2;
2117 B get f3; 2152 B get f3;
(...skipping 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after
4038 // Regression test for https://github.com/dart-lang/sdk/issues/25069 4073 // Regression test for https://github.com/dart-lang/sdk/issues/25069
4039 checkFile(''' 4074 checkFile('''
4040 typedef int Foo(); 4075 typedef int Foo();
4041 void foo() {} 4076 void foo() {}
4042 void main () { 4077 void main () {
4043 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); 4078 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo();
4044 } 4079 }
4045 '''); 4080 ''');
4046 } 4081 }
4047 } 4082 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/strong_mode_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698