| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.generated.hint_code_test; | 5 library analyzer.test.generated.hint_code_test; |
| 6 | 6 |
| 7 import 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
| 8 import 'package:analyzer/src/error/codes.dart'; | 8 import 'package:analyzer/src/error/codes.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/parser.dart'; | 10 import 'package:analyzer/src/generated/parser.dart'; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 m() { | 161 m() { |
| 162 var i = ''; | 162 var i = ''; |
| 163 n(i); | 163 n(i); |
| 164 } | 164 } |
| 165 n(int i) {}'''); | 165 n(int i) {}'''); |
| 166 await computeAnalysisResult(source); | 166 await computeAnalysisResult(source); |
| 167 assertErrors(source, [HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); | 167 assertErrors(source, [HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); |
| 168 verify([source]); | 168 verify([source]); |
| 169 } | 169 } |
| 170 | 170 |
| 171 test_async_future_object_without_return() async { | |
| 172 Source source = addSource(''' | |
| 173 import 'dart:async'; | |
| 174 Future<Object> f() async {} | |
| 175 '''); | |
| 176 await computeAnalysisResult(source); | |
| 177 assertErrors(source, [HintCode.MISSING_RETURN]); | |
| 178 verify([source]); | |
| 179 } | |
| 180 | |
| 181 test_canBeNullAfterNullAware_false_methodInvocation() async { | 171 test_canBeNullAfterNullAware_false_methodInvocation() async { |
| 182 Source source = addSource(r''' | 172 Source source = addSource(r''' |
| 183 m(x) { | 173 m(x) { |
| 184 x?.a()?.b(); | 174 x?.a()?.b(); |
| 185 } | 175 } |
| 186 '''); | 176 '''); |
| 187 await computeAnalysisResult(source); | 177 await computeAnalysisResult(source); |
| 188 assertNoErrors(source); | 178 assertNoErrors(source); |
| 189 verify([source]); | 179 verify([source]); |
| 190 } | 180 } |
| (...skipping 3852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4043 n() { | 4033 n() { |
| 4044 var a = m(), b = m(); | 4034 var a = m(), b = m(); |
| 4045 } | 4035 } |
| 4046 }'''); | 4036 }'''); |
| 4047 await computeAnalysisResult(source); | 4037 await computeAnalysisResult(source); |
| 4048 assertErrors( | 4038 assertErrors( |
| 4049 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); | 4039 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); |
| 4050 verify([source]); | 4040 verify([source]); |
| 4051 } | 4041 } |
| 4052 } | 4042 } |
| OLD | NEW |