| 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 a1170ef89c78c06f4e35dec9b6aff2a07721aa80..1622cbc155e63b79162c038132ff9de0b818c4f1 100644
|
| --- a/pkg/analyzer/test/src/task/strong/checker_test.dart
|
| +++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
|
| @@ -247,7 +247,7 @@ void main() {
|
| class B extends A {
|
| B() : super(/*severe:STATIC_TYPE_ERROR*/"hello");
|
|
|
| - B.c2(int x, String y) : super.c2(/*severe:STATIC_TYPE_ERROR*/y,
|
| + B.c2(int x, String y) : super.c2(/*severe:STATIC_TYPE_ERROR*/y,
|
| /*severe:STATIC_TYPE_ERROR*/x);
|
|
|
| B.c3(num x, Object y) : super.c3(x, /*info:DOWN_CAST_IMPLICIT*/y);
|
| @@ -1351,6 +1351,51 @@ void main() {
|
| '''
|
| });
|
|
|
| + testChecker('generic class method override', {
|
| + '/main.dart': '''
|
| + class A {}
|
| + class B extends A {}
|
| +
|
| + class Base<T extends B> {
|
| + T foo() => null;
|
| + }
|
| +
|
| + class Derived<S extends A> extends Base<B> {
|
| + /*severe:INVALID_METHOD_OVERRIDE*/S foo() => null;
|
| + }
|
| +
|
| + class Derived2<S extends B> extends Base<B> {
|
| + S foo() => null;
|
| + }
|
| + '''
|
| + });
|
| +
|
| + testChecker('generic method override', {
|
| + '/main.dart': '''
|
| + class Future<T> {
|
| + /*=S*/ then/*<S>*/(/*=S*/ onValue(T t)) => null;
|
| + }
|
| +
|
| + // These work because they're exactly equal FunctionTypes
|
| + class DerivedFuture<T> extends Future<T> {
|
| + /*=S*/ then/*<S>*/(/*=S*/ onValue(T t)) => null;
|
| + }
|
| +
|
| + class DerivedFuture2<A> extends Future<A> {
|
| + /*=B*/ then/*<B>*/(/*=B*/ onValue(A a)) => null;
|
| + }
|
| +
|
| + // These don't work but should.
|
| + class DerivedFuture3<T> extends Future<T> {
|
| + /*=/*severe:INVALID_METHOD_OVERRIDE should be pass*/S*/ then/*<S>*/(Object onValue(T t)) => null;
|
| + }
|
| +
|
| + class DerivedFuture4<A> extends Future<A> {
|
| + /*=/*severe:INVALID_METHOD_OVERRIDE should be pass*/B*/ then/*<B>*/(Object onValue(A a)) => null;
|
| + }
|
| + '''
|
| + });
|
| +
|
| testChecker('unary operators', {
|
| '/main.dart': '''
|
| class A {
|
|
|