Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: pkg/analyzer/test/generated/hint_code_test.dart

Issue 2638183002: Issue 28027. Move Null to the bottom in the Analyzer. (Closed)
Patch Set: Fixes for review comments. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/strong_mode.dart ('k') | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698