Chromium Code Reviews| 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..c4c894a698219b09c6839992783621b5cd8c6f08 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''' |
| +T foo<T>(T x) => x; |
| + |
| +void takesDtoD(dynamic f(dynamic x)) {} |
| + |
| +void test() { |
| + // here we currently infer an instantiation. |
| + takesDtoD(/*pass should be error:INVALID_ASSIGNMENT*/foo); |
|
Leaf
2016/12/02 01:59:10
I think if you make it
dynamic foo<T>(dynamic x)
Jennifer Messerly
2016/12/02 03:24:00
hmmm, tried it and it's still too smart to infer.
|
| +} |
| + |
| +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(''' |