| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer.test.src.task.strong.checker_test; | 5 library analyzer.test.src.task.strong.checker_test; |
| 6 | 6 |
| 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 8 | 8 |
| 9 import 'strong_test_helper.dart'; | 9 import 'strong_test_helper.dart'; |
| 10 | 10 |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 void test_functionModifiers_async() { | 930 void test_functionModifiers_async() { |
| 931 checkFile(''' | 931 checkFile(''' |
| 932 import 'dart:async'; | 932 import 'dart:async'; |
| 933 import 'dart:math' show Random; | 933 import 'dart:math' show Random; |
| 934 | 934 |
| 935 dynamic x; | 935 dynamic x; |
| 936 | 936 |
| 937 foo1() async => x; | 937 foo1() async => x; |
| 938 Future foo2() async => x; | 938 Future foo2() async => x; |
| 939 Future<int> foo3() async => x; | 939 Future<int> foo3() async => x; |
| 940 Future<int> foo4() async => new Future<int>.value(/*info:DYNAMIC_CAST*/x); | 940 Future<int> foo4() async => new Future<int>.value(x); |
| 941 Future<int> foo5() async => | 941 Future<int> foo5() async => |
| 942 /*error:RETURN_OF_INVALID_TYPE*/new Future<String>.value(/*info:DYNAMIC_CAST
*/x); | 942 /*error:RETURN_OF_INVALID_TYPE*/new Future<String>.value(x); |
| 943 | 943 |
| 944 bar1() async { return x; } | 944 bar1() async { return x; } |
| 945 Future bar2() async { return x; } | 945 Future bar2() async { return x; } |
| 946 Future<int> bar3() async { return x; } | 946 Future<int> bar3() async { return x; } |
| 947 Future<int> bar4() async { return new Future<int>.value(/*info:DYNAMIC_CAST*/x);
} | 947 Future<int> bar4() async { return new Future<int>.value(x); } |
| 948 Future<int> bar5() async { | 948 Future<int> bar5() async { |
| 949 return /*error:RETURN_OF_INVALID_TYPE*/new Future<String>.value(/*info:DYNAMIC
_CAST*/x); | 949 return /*error:RETURN_OF_INVALID_TYPE*/new Future<String>.value(x); |
| 950 } | 950 } |
| 951 | 951 |
| 952 int y; | 952 int y; |
| 953 Future<int> z; | 953 Future<int> z; |
| 954 | 954 |
| 955 baz() async { | 955 baz() async { |
| 956 int a = /*info:DYNAMIC_CAST*/await x; | 956 int a = /*info:DYNAMIC_CAST*/await x; |
| 957 int b = await y; | 957 int b = await y; |
| 958 int c = await z; | 958 int c = await z; |
| 959 String d = /*error:INVALID_ASSIGNMENT*/await z; | 959 String d = /*error:INVALID_ASSIGNMENT*/await z; |
| (...skipping 3067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4027 // Regression test for https://github.com/dart-lang/sdk/issues/25069 | 4027 // Regression test for https://github.com/dart-lang/sdk/issues/25069 |
| 4028 checkFile(''' | 4028 checkFile(''' |
| 4029 typedef int Foo(); | 4029 typedef int Foo(); |
| 4030 void foo() {} | 4030 void foo() {} |
| 4031 void main () { | 4031 void main () { |
| 4032 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); | 4032 Foo x = /*error:INVALID_ASSIGNMENT,info:USE_OF_VOID_RESULT*/foo(); |
| 4033 } | 4033 } |
| 4034 '''); | 4034 '''); |
| 4035 } | 4035 } |
| 4036 } | 4036 } |
| OLD | NEW |