| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine.resolver; | 3 library engine.resolver; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
| 6 import 'java_engine.dart'; | 6 import 'java_engine.dart'; |
| 7 import 'instrumentation.dart'; | 7 import 'instrumentation.dart'; |
| 8 import 'source.dart'; | 8 import 'source.dart'; |
| 9 import 'error.dart'; | 9 import 'error.dart'; |
| 10 import 'scanner.dart' as sc; | 10 import 'scanner.dart' as sc; |
| (...skipping 12575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12586 for (FieldElement fieldElement in fieldElements) { | 12586 for (FieldElement fieldElement in fieldElements) { |
| 12587 if (!fieldElement.isSynthetic) { | 12587 if (!fieldElement.isSynthetic) { |
| 12588 _initialFieldElementsMap[fieldElement] = fieldElement.initializer ==
null ? INIT_STATE.NOT_INIT : INIT_STATE.INIT_IN_DECLARATION; | 12588 _initialFieldElementsMap[fieldElement] = fieldElement.initializer ==
null ? INIT_STATE.NOT_INIT : INIT_STATE.INIT_IN_DECLARATION; |
| 12589 } | 12589 } |
| 12590 } | 12590 } |
| 12591 } | 12591 } |
| 12592 checkForFinalNotInitialized(node); | 12592 checkForFinalNotInitialized(node); |
| 12593 checkForDuplicateDefinitionInheritance(); | 12593 checkForDuplicateDefinitionInheritance(); |
| 12594 checkForConflictingGetterAndMethod(); | 12594 checkForConflictingGetterAndMethod(); |
| 12595 checkImplementsSuperClass(node); | 12595 checkImplementsSuperClass(node); |
| 12596 checkImplementsFunctionWithoutCall(node); |
| 12596 return super.visitClassDeclaration(node); | 12597 return super.visitClassDeclaration(node); |
| 12597 } finally { | 12598 } finally { |
| 12598 _isInNativeClass = false; | 12599 _isInNativeClass = false; |
| 12599 _initialFieldElementsMap = null; | 12600 _initialFieldElementsMap = null; |
| 12600 _enclosingClass = outerClass; | 12601 _enclosingClass = outerClass; |
| 12601 } | 12602 } |
| 12602 } | 12603 } |
| 12603 Object visitClassTypeAlias(ClassTypeAlias node) { | 12604 Object visitClassTypeAlias(ClassTypeAlias node) { |
| 12604 checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDE
NTIFIER_AS_TYPEDEF_NAME); | 12605 checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDE
NTIFIER_AS_TYPEDEF_NAME); |
| 12605 checkForAllMixinErrorCodes(node.withClause); | 12606 checkForAllMixinErrorCodes(node.withClause); |
| (...skipping 3582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16188 } | 16189 } |
| 16189 NodeList<FormalParameter> parameters = parameterList.parameters; | 16190 NodeList<FormalParameter> parameters = parameterList.parameters; |
| 16190 if (parameters.length != 1 || parameters[0].kind != ParameterKind.REQUIRED)
{ | 16191 if (parameters.length != 1 || parameters[0].kind != ParameterKind.REQUIRED)
{ |
| 16191 _errorReporter.reportError2(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETER
S_FOR_SETTER, setterName, []); | 16192 _errorReporter.reportError2(CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETER
S_FOR_SETTER, setterName, []); |
| 16192 return true; | 16193 return true; |
| 16193 } | 16194 } |
| 16194 return false; | 16195 return false; |
| 16195 } | 16196 } |
| 16196 | 16197 |
| 16197 /** | 16198 /** |
| 16199 * This verifies that if the given class declaration implements the class Func
tion that it has a |
| 16200 * concrete implementation of the call method. |
| 16201 * |
| 16202 * @return `true` if and only if an error code is generated on the passed node |
| 16203 * @see StaticWarningCode#FUNCTION_WITHOUT_CALL |
| 16204 */ |
| 16205 bool checkImplementsFunctionWithoutCall(ClassDeclaration node) { |
| 16206 if (node.abstractKeyword != null) { |
| 16207 return false; |
| 16208 } |
| 16209 ClassElement classElement = node.element; |
| 16210 if (classElement == null) { |
| 16211 return false; |
| 16212 } |
| 16213 if (!classElement.type.isSubtypeOf(_typeProvider.functionType)) { |
| 16214 return false; |
| 16215 } |
| 16216 ExecutableElement callMethod = _inheritanceManager.lookupMember(classElement
, "call"); |
| 16217 if (callMethod == null || callMethod is! MethodElement || ((callMethod as Me
thodElement)).isAbstract) { |
| 16218 _errorReporter.reportError2(StaticWarningCode.FUNCTION_WITHOUT_CALL, node.
name, []); |
| 16219 return true; |
| 16220 } |
| 16221 return false; |
| 16222 } |
| 16223 |
| 16224 /** |
| 16198 * This verifies that the given class declaration does not have the same class
in the 'extends' | 16225 * This verifies that the given class declaration does not have the same class
in the 'extends' |
| 16199 * and 'implements' clauses. | 16226 * and 'implements' clauses. |
| 16200 * | 16227 * |
| 16201 * @return `true` if and only if an error code is generated on the passed node | 16228 * @return `true` if and only if an error code is generated on the passed node |
| 16202 * @see CompileTimeErrorCode#IMPLEMENTS_SUPER_CLASS | 16229 * @see CompileTimeErrorCode#IMPLEMENTS_SUPER_CLASS |
| 16203 */ | 16230 */ |
| 16204 bool checkImplementsSuperClass(ClassDeclaration node) { | 16231 bool checkImplementsSuperClass(ClassDeclaration node) { |
| 16205 InterfaceType superType = _enclosingClass.supertype; | 16232 InterfaceType superType = _enclosingClass.supertype; |
| 16206 if (superType == null) { | 16233 if (superType == null) { |
| 16207 return false; | 16234 return false; |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16631 ResolverErrorCode.con2(String name, int ordinal, ErrorType type, String messag
e, String correction) : super(name, ordinal) { | 16658 ResolverErrorCode.con2(String name, int ordinal, ErrorType type, String messag
e, String correction) : super(name, ordinal) { |
| 16632 this._type = type; | 16659 this._type = type; |
| 16633 this._message = message; | 16660 this._message = message; |
| 16634 this.correction9 = correction; | 16661 this.correction9 = correction; |
| 16635 } | 16662 } |
| 16636 String get correction => correction9; | 16663 String get correction => correction9; |
| 16637 ErrorSeverity get errorSeverity => _type.severity; | 16664 ErrorSeverity get errorSeverity => _type.severity; |
| 16638 String get message => _message; | 16665 String get message => _message; |
| 16639 ErrorType get type => _type; | 16666 ErrorType get type => _type; |
| 16640 } | 16667 } |
| OLD | NEW |