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

Unified 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, 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
« no previous file with comments | « pkg/analyzer/test/generated/strong_mode_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5b7e646e695881a91657e6eb0a0fd9ed9757bd20..69ae478a830252c2f8a2a9f49a55de07465d1674 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -2105,6 +2105,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 {}
« 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