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 6c22865f6308266d456bfa7690ae1df59a61ae91..6ad54c7183b5b905683111a305c2bc14f3896f7f 100644 |
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart |
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart |
@@ -3991,6 +3991,27 @@ void main() { |
'''); |
} |
+ void test_universalFunctionSubtyping() { |
+ checkFile(r''' |
+dynamic foo<T>(dynamic x) => x; |
+ |
+void takesDtoD(dynamic f(dynamic x)) {} |
+ |
+void test() { |
+ // here we currently infer an instantiation. |
+ takesDtoD(/*pass should be error:INVALID_ASSIGNMENT*/foo); |
+} |
+ |
+class A { |
+ dynamic method(dynamic x) => x; |
+} |
+ |
+class B extends A { |
+ /*error:INVALID_METHOD_OVERRIDE*/T method<T>(T x) => x; |
+} |
+ '''); |
+ } |
+ |
void test_voidSubtyping() { |
// Regression test for https://github.com/dart-lang/sdk/issues/25069 |
checkFile(''' |