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

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

Issue 2630023003: Report HintCode.MISSING_RETURN for async functions with return type that matters. (Closed)
Patch Set: 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
« no previous file with comments | « pkg/analyzer/test/generated/hint_code_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.non_error_resolver_test; 5 library analyzer.test.generated.non_error_resolver_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 import 'dart:async'; 695 import 'dart:async';
696 Future<Object> f() async { 696 Future<Object> f() async {
697 return 5; 697 return 5;
698 } 698 }
699 '''); 699 ''');
700 await computeAnalysisResult(source); 700 await computeAnalysisResult(source);
701 assertNoErrors(source); 701 assertNoErrors(source);
702 verify([source]); 702 verify([source]);
703 } 703 }
704 704
705 test_async_future_object_without_return() async {
Brian Wilkerson 2017/01/15 17:22:53 We should test that we don't produce an error in c
scheglov 2017/01/15 17:48:02 There are tests: test_async_future_null_with_retur
706 Source source = addSource('''
707 import 'dart:async';
708 Future<Object> f() async {}
709 ''');
710 await computeAnalysisResult(source);
711 assertNoErrors(source);
712 verify([source]);
713 }
714
715 test_async_future_with_return() async { 705 test_async_future_with_return() async {
716 Source source = addSource(''' 706 Source source = addSource('''
717 import 'dart:async'; 707 import 'dart:async';
718 Future f() async { 708 Future f() async {
719 return; 709 return;
720 } 710 }
721 '''); 711 ''');
722 await computeAnalysisResult(source); 712 await computeAnalysisResult(source);
723 assertNoErrors(source); 713 assertNoErrors(source);
724 verify([source]); 714 verify([source]);
(...skipping 5523 matching lines...) Expand 10 before | Expand all | Expand 10 after
6248 } 6238 }
6249 6239
6250 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { 6240 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async {
6251 await _check_wrongNumberOfParametersForOperator(name, "a"); 6241 await _check_wrongNumberOfParametersForOperator(name, "a");
6252 } 6242 }
6253 6243
6254 Future<CompilationUnit> _getResolvedLibraryUnit(Source source) async { 6244 Future<CompilationUnit> _getResolvedLibraryUnit(Source source) async {
6255 return analysisContext.getResolvedCompilationUnit2(source, source); 6245 return analysisContext.getResolvedCompilationUnit2(source, source);
6256 } 6246 }
6257 } 6247 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/hint_code_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698