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

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 912023002: Use ExitDetector.exists(node). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | 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 engine.resolver; 5 library engine.resolver;
6 6
7 import "dart:math" as math; 7 import "dart:math" as math;
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/generated/utilities_collection.dart'; 10 import 'package:analyzer/src/generated/utilities_collection.dart';
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 if (returnTypeType == null || returnTypeType.isVoid) { 591 if (returnTypeType == null || returnTypeType.isVoid) {
592 return false; 592 return false;
593 } 593 }
594 // For async, give no hint if Future<Null> is assignable to the return 594 // For async, give no hint if Future<Null> is assignable to the return
595 // type. 595 // type.
596 if (body.isAsynchronous && _futureNullType.isAssignableTo(returnTypeType)) { 596 if (body.isAsynchronous && _futureNullType.isAssignableTo(returnTypeType)) {
597 return false; 597 return false;
598 } 598 }
599 // Check the block for a return statement, if not, create the hint 599 // Check the block for a return statement, if not, create the hint
600 BlockFunctionBody blockFunctionBody = body as BlockFunctionBody; 600 BlockFunctionBody blockFunctionBody = body as BlockFunctionBody;
601 if (!blockFunctionBody.accept(new ExitDetector())) { 601 if (!ExitDetector.exits(blockFunctionBody)) {
602 _errorReporter.reportErrorForNode( 602 _errorReporter.reportErrorForNode(
603 HintCode.MISSING_RETURN, 603 HintCode.MISSING_RETURN,
604 returnType, 604 returnType,
605 [returnTypeType.displayName]); 605 [returnTypeType.displayName]);
606 return true; 606 return true;
607 } 607 }
608 return false; 608 return false;
609 } 609 }
610 610
611 /** 611 /**
(...skipping 15082 matching lines...) Expand 10 before | Expand all | Expand 10 after
15694 * library. 15694 * library.
15695 */ 15695 */
15696 final HashSet<String> members = new HashSet<String>(); 15696 final HashSet<String> members = new HashSet<String>();
15697 15697
15698 /** 15698 /**
15699 * Names of resolved or unresolved class members that are read in the 15699 * Names of resolved or unresolved class members that are read in the
15700 * library. 15700 * library.
15701 */ 15701 */
15702 final HashSet<String> readMembers = new HashSet<String>(); 15702 final HashSet<String> readMembers = new HashSet<String>();
15703 } 15703 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698