| 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 analyzer.src.generated.error_verifier; | 5 library analyzer.src.generated.error_verifier; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import "dart:math" as math; | 8 import "dart:math" as math; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 4262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4273 } | 4273 } |
| 4274 } | 4274 } |
| 4275 int nameCount = constantNames.length; | 4275 int nameCount = constantNames.length; |
| 4276 if (nameCount == 0) { | 4276 if (nameCount == 0) { |
| 4277 return false; | 4277 return false; |
| 4278 } | 4278 } |
| 4279 for (int i = 0; i < nameCount; i++) { | 4279 for (int i = 0; i < nameCount; i++) { |
| 4280 int offset = statement.offset; | 4280 int offset = statement.offset; |
| 4281 int end = statement.rightParenthesis.end; | 4281 int end = statement.rightParenthesis.end; |
| 4282 _errorReporter.reportErrorForOffset( | 4282 _errorReporter.reportErrorForOffset( |
| 4283 CompileTimeErrorCode.MISSING_ENUM_CONSTANT_IN_SWITCH, | 4283 StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, |
| 4284 offset, | 4284 offset, |
| 4285 end - offset, | 4285 end - offset, |
| 4286 [constantNames[i]]); | 4286 [constantNames[i]]); |
| 4287 } | 4287 } |
| 4288 return true; | 4288 return true; |
| 4289 } | 4289 } |
| 4290 | 4290 |
| 4291 /** | 4291 /** |
| 4292 * Verify that the given function [body] does not contain return statements | 4292 * Verify that the given function [body] does not contain return statements |
| 4293 * that both have and do not have return values. | 4293 * that both have and do not have return values. |
| (...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6203 toCheck.add(type.element); | 6203 toCheck.add(type.element); |
| 6204 // type arguments | 6204 // type arguments |
| 6205 if (type is InterfaceType) { | 6205 if (type is InterfaceType) { |
| 6206 InterfaceType interfaceType = type; | 6206 InterfaceType interfaceType = type; |
| 6207 for (DartType typeArgument in interfaceType.typeArguments) { | 6207 for (DartType typeArgument in interfaceType.typeArguments) { |
| 6208 _addTypeToCheck(typeArgument); | 6208 _addTypeToCheck(typeArgument); |
| 6209 } | 6209 } |
| 6210 } | 6210 } |
| 6211 } | 6211 } |
| 6212 } | 6212 } |
| OLD | NEW |