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

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

Issue 2653873002: fix #28141, fix super generic method bounds check (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/src/task/strong/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 9401f1a6a52ed166afadc16ec48626094703c90a..7cde3b0c3a05e84c1d7c2f174353c0347e561a2f 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -2094,6 +2094,41 @@ class DerivedFuture4<A> extends Future<A> {
''');
}
+ void test_genericMethodSuper() {
+ checkFile(r'''
+class A<T> {
+ A<S> create<S extends T>() => new A<S>();
+}
+class B extends A {
+ A<S> create<S>() => super.create<S>();
+}
+class C extends A {
+ A<S> create<S>() => super.create();
+}
+class D extends A<num> {
+ A<S> create<S extends num>() => super.create<S>();
+}
+class E extends A<num> {
+ A<S> create<S extends num>() => /*error:RETURN_OF_INVALID_TYPE*/super.create<int>();
+}
+class F extends A<num> {
+ create2<S>() => super.create</*error:TYPE_ARGUMENT_NOT_MATCHING_BOUNDS*/S>();
+}
+ ''');
+ }
+
+ void test_genericMethodSuperSubstitute() {
+ checkFile(r'''
+class Clonable<T> {}
+class G<T> {
+ create<A extends Clonable<T>, B extends Iterable<A>>() => null;
+}
+class H extends G<num> {
+ create2() => super.create<Clonable<int>, List<Clonable<int>>>();
+}
+ ''');
+ }
+
void test_getterGetterOverride() {
checkFile('''
class A {}

Powered by Google App Engine
This is Rietveld 408576698