| 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.error_verifier; | 5 library engine.resolver.error_verifier; |
| 6 | 6 |
| 7 import 'dart:collection'; |
| 7 import "dart:math" as math; | 8 import "dart:math" as math; |
| 8 import 'dart:collection'; | |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/static_type_analyzer.dart'; | 10 import 'package:analyzer/src/generated/static_type_analyzer.dart'; |
| 11 | 11 |
| 12 import 'ast.dart'; | 12 import 'ast.dart'; |
| 13 import 'constant.dart'; | 13 import 'constant.dart'; |
| 14 import 'element.dart'; | 14 import 'element.dart'; |
| 15 import 'element_resolver.dart'; | 15 import 'element_resolver.dart'; |
| 16 import 'error.dart'; | 16 import 'error.dart'; |
| 17 import 'java_engine.dart'; | 17 import 'java_engine.dart'; |
| 18 import 'parser.dart' show Parser, ParserErrorCode; | 18 import 'parser.dart' show Parser, ParserErrorCode; |
| (...skipping 4150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4169 * the node to report problem on. The [mixinElement] is the mixing to | 4169 * the node to report problem on. The [mixinElement] is the mixing to |
| 4170 * evaluate. | 4170 * evaluate. |
| 4171 * | 4171 * |
| 4172 * See [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]. | 4172 * See [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]. |
| 4173 */ | 4173 */ |
| 4174 bool _checkForMixinInheritsNotFromObject( | 4174 bool _checkForMixinInheritsNotFromObject( |
| 4175 TypeName mixinName, ClassElement mixinElement) { | 4175 TypeName mixinName, ClassElement mixinElement) { |
| 4176 InterfaceType mixinSupertype = mixinElement.supertype; | 4176 InterfaceType mixinSupertype = mixinElement.supertype; |
| 4177 if (mixinSupertype != null) { | 4177 if (mixinSupertype != null) { |
| 4178 if (!mixinSupertype.isObject || | 4178 if (!mixinSupertype.isObject || |
| 4179 !mixinElement.isTypedef && mixinElement.mixins.length != 0) { | 4179 !mixinElement.isMixinApplication && mixinElement.mixins.length != 0) { |
| 4180 _errorReporter.reportErrorForNode( | 4180 _errorReporter.reportErrorForNode( |
| 4181 CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, mixinName, | 4181 CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, mixinName, |
| 4182 [mixinElement.name]); | 4182 [mixinElement.name]); |
| 4183 return true; | 4183 return true; |
| 4184 } | 4184 } |
| 4185 } | 4185 } |
| 4186 return false; | 4186 return false; |
| 4187 } | 4187 } |
| 4188 | 4188 |
| 4189 /** | 4189 /** |
| (...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5971 toCheck.add(type.element); | 5971 toCheck.add(type.element); |
| 5972 // type arguments | 5972 // type arguments |
| 5973 if (type is InterfaceType) { | 5973 if (type is InterfaceType) { |
| 5974 InterfaceType interfaceType = type; | 5974 InterfaceType interfaceType = type; |
| 5975 for (DartType typeArgument in interfaceType.typeArguments) { | 5975 for (DartType typeArgument in interfaceType.typeArguments) { |
| 5976 _addTypeToCheck(typeArgument); | 5976 _addTypeToCheck(typeArgument); |
| 5977 } | 5977 } |
| 5978 } | 5978 } |
| 5979 } | 5979 } |
| 5980 } | 5980 } |
| OLD | NEW |