| Index: pkg/analyzer_experimental/lib/src/generated/resolver.dart
|
| diff --git a/pkg/analyzer_experimental/lib/src/generated/resolver.dart b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
|
| index 33b7305592e5fb400011ace2263f97aa367f7815..0ff54abf0c4259d2f1cd1d32c52ba24e663aa90f 100644
|
| --- a/pkg/analyzer_experimental/lib/src/generated/resolver.dart
|
| +++ b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
|
| @@ -12593,6 +12593,7 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
|
| checkForDuplicateDefinitionInheritance();
|
| checkForConflictingGetterAndMethod();
|
| checkImplementsSuperClass(node);
|
| + checkImplementsFunctionWithoutCall(node);
|
| return super.visitClassDeclaration(node);
|
| } finally {
|
| _isInNativeClass = false;
|
| @@ -16195,6 +16196,32 @@ class ErrorVerifier extends RecursiveASTVisitor<Object> {
|
| }
|
|
|
| /**
|
| + * This verifies that if the given class declaration implements the class Function that it has a
|
| + * concrete implementation of the call method.
|
| + *
|
| + * @return `true` if and only if an error code is generated on the passed node
|
| + * @see StaticWarningCode#FUNCTION_WITHOUT_CALL
|
| + */
|
| + bool checkImplementsFunctionWithoutCall(ClassDeclaration node) {
|
| + if (node.abstractKeyword != null) {
|
| + return false;
|
| + }
|
| + ClassElement classElement = node.element;
|
| + if (classElement == null) {
|
| + return false;
|
| + }
|
| + if (!classElement.type.isSubtypeOf(_typeProvider.functionType)) {
|
| + return false;
|
| + }
|
| + ExecutableElement callMethod = _inheritanceManager.lookupMember(classElement, "call");
|
| + if (callMethod == null || callMethod is! MethodElement || ((callMethod as MethodElement)).isAbstract) {
|
| + _errorReporter.reportError2(StaticWarningCode.FUNCTION_WITHOUT_CALL, node.name, []);
|
| + return true;
|
| + }
|
| + return false;
|
| + }
|
| +
|
| + /**
|
| * This verifies that the given class declaration does not have the same class in the 'extends'
|
| * and 'implements' clauses.
|
| *
|
|
|