| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |