| Index: pkg/analyzer/lib/src/generated/resolver.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
|
| index 824f392f5870a0808daa54b258e2ecb9e8ec1e27..f1e857c4e7ef713a823278492c47243c641e57b9 100644
|
| --- a/pkg/analyzer/lib/src/generated/resolver.dart
|
| +++ b/pkg/analyzer/lib/src/generated/resolver.dart
|
| @@ -1461,7 +1461,7 @@ class ConstantVerifier extends RecursiveAstVisitor<Object> {
|
| }
|
| }
|
| } else {
|
| - EvaluationResultImpl result = key.accept(new ConstantVisitor(_typeProvider));
|
| + EvaluationResultImpl result = key.accept(new ConstantVisitor.con1(_typeProvider));
|
| if (result is ValidResult) {
|
| DartObject value = result.value;
|
| if (keys.contains(value)) {
|
| @@ -1646,7 +1646,7 @@ class ConstantVerifier extends RecursiveAstVisitor<Object> {
|
| * @return the value of the compile time constant
|
| */
|
| EvaluationResultImpl _validate(Expression expression, ErrorCode errorCode) {
|
| - EvaluationResultImpl result = expression.accept(new ConstantVisitor(_typeProvider));
|
| + EvaluationResultImpl result = expression.accept(new ConstantVisitor.con1(_typeProvider));
|
| _reportErrors(result, errorCode);
|
| return result;
|
| }
|
| @@ -1770,7 +1770,7 @@ class ConstantVisitor_ConstantVerifier_validateInitializerExpression extends Con
|
|
|
| List<ParameterElement> parameterElements;
|
|
|
| - ConstantVisitor_ConstantVerifier_validateInitializerExpression(TypeProvider arg0, this.ConstantVerifier_this, this.parameterElements) : super(arg0);
|
| + ConstantVisitor_ConstantVerifier_validateInitializerExpression(TypeProvider arg0, this.ConstantVerifier_this, this.parameterElements) : super.con1(arg0);
|
|
|
| @override
|
| EvaluationResultImpl visitSimpleIdentifier(SimpleIdentifier node) {
|
| @@ -5153,6 +5153,9 @@ class ElementResolver extends SimpleAstVisitor<Object> {
|
| // Generate the type name.
|
| // The error code will never be generated via type propagation
|
| DartType targetType = _getStaticType(target);
|
| + if (targetType is InterfaceType && !targetType.isObject) {
|
| + targetType = (targetType as InterfaceType).superclass;
|
| + }
|
| String targetTypeName = targetType == null ? null : targetType.name;
|
| _resolver.reportErrorForNode(StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, methodName, [methodName.name, targetTypeName]);
|
| }
|
| @@ -7263,6 +7266,12 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| }
|
|
|
| @override
|
| + Object visitAsExpression(AsExpression node) {
|
| + _checkForTypeAnnotationDeferredClass(node.type);
|
| + return super.visitAsExpression(node);
|
| + }
|
| +
|
| + @override
|
| Object visitAssertStatement(AssertStatement node) {
|
| _checkForNonBoolExpression(node);
|
| return super.visitAssertStatement(node);
|
| @@ -7285,7 +7294,15 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
|
|
| @override
|
| Object visitBinaryExpression(BinaryExpression node) {
|
| - _checkForArgumentTypeNotAssignableForArgument(node.rightOperand);
|
| + sc.Token operator = node.operator;
|
| + sc.TokenType type = operator.type;
|
| + if (type == sc.TokenType.AMPERSAND_AMPERSAND || type == sc.TokenType.BAR_BAR) {
|
| + String lexeme = operator.lexeme;
|
| + _checkForAssignability(node.leftOperand, _boolType, StaticTypeWarningCode.NON_BOOL_OPERAND, [lexeme]);
|
| + _checkForAssignability(node.rightOperand, _boolType, StaticTypeWarningCode.NON_BOOL_OPERAND, [lexeme]);
|
| + } else {
|
| + _checkForArgumentTypeNotAssignableForArgument(node.rightOperand);
|
| + }
|
| return super.visitBinaryExpression(node);
|
| }
|
|
|
| @@ -7325,6 +7342,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| bool previousIsInCatchClause = _isInCatchClause;
|
| try {
|
| _isInCatchClause = true;
|
| + _checkForTypeAnnotationDeferredClass(node.exceptionType);
|
| return super.visitCatchClause(node);
|
| } finally {
|
| _isInCatchClause = previousIsInCatchClause;
|
| @@ -7663,6 +7681,12 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| }
|
|
|
| @override
|
| + Object visitIsExpression(IsExpression node) {
|
| + _checkForTypeAnnotationDeferredClass(node.type);
|
| + return super.visitIsExpression(node);
|
| + }
|
| +
|
| + @override
|
| Object visitListLiteral(ListLiteral node) {
|
| TypeArgumentList typeArguments = node.typeArguments;
|
| if (typeArguments != null) {
|
| @@ -8689,6 +8713,31 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| }
|
|
|
| /**
|
| + * Check that the static type of the given expression is assignable to the given type. If it
|
| + * isn't, report an error with the given error code.
|
| + *
|
| + * @param expression the expression being tested
|
| + * @param type the type that the expression must be assignable to
|
| + * @param errorCode the error code to be reported
|
| + * @param arguments the arguments to pass in when creating the error
|
| + * @return `true` if an error was reported
|
| + */
|
| + bool _checkForAssignability(Expression expression, InterfaceType type, ErrorCode errorCode, List<Object> arguments) {
|
| + if (expression == null) {
|
| + return false;
|
| + }
|
| + DartType expressionType = expression.staticType;
|
| + if (expressionType == null) {
|
| + return false;
|
| + }
|
| + if (expressionType.isAssignableTo(type)) {
|
| + return false;
|
| + }
|
| + _errorReporter.reportErrorForNode(errorCode, expression, arguments);
|
| + return true;
|
| + }
|
| +
|
| + /**
|
| * This verifies that the passed expression is not final.
|
| *
|
| * @param node the expression to evaluate
|
| @@ -8723,6 +8772,10 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| return true;
|
| }
|
| if (variable.isFinal) {
|
| + if (variable is FieldElementImpl && variable.setter == null && variable.isSynthetic) {
|
| + _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_FINAL_NO_SETTER, highlightedNode, [variable.name, variable.enclosingElement.displayName]);
|
| + return true;
|
| + }
|
| _errorReporter.reportErrorForNode(StaticWarningCode.ASSIGNMENT_TO_FINAL, highlightedNode, [variable.name]);
|
| return true;
|
| }
|
| @@ -9212,6 +9265,11 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| if (node.factoryKeyword != null) {
|
| return false;
|
| }
|
| + // check for mixins
|
| + if (_enclosingClass.mixins.length != 0) {
|
| + _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN, node.returnType, []);
|
| + return true;
|
| + }
|
| // try to find and check super constructor invocation
|
| for (ConstructorInitializer initializer in node.initializers) {
|
| if (initializer is SuperConstructorInvocation) {
|
| @@ -9220,7 +9278,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| if (element == null || element.isConst) {
|
| return false;
|
| }
|
| - _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, superInvocation, []);
|
| + _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, superInvocation, [element.enclosingElement.displayName]);
|
| return true;
|
| }
|
| }
|
| @@ -9240,7 +9298,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| return false;
|
| }
|
| // default constructor is not 'const', report problem
|
| - _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, node.returnType, []);
|
| + _errorReporter.reportErrorForNode(CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, node.returnType, [supertype.displayName]);
|
| return true;
|
| }
|
|
|
| @@ -12005,13 +12063,13 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| bool visitArgumentList(ArgumentList node) => _visitExpressions(node.arguments);
|
|
|
| @override
|
| - bool visitAsExpression(AsExpression node) => node.expression.accept(this);
|
| + bool visitAsExpression(AsExpression node) => _nodeExits(node.expression);
|
|
|
| @override
|
| - bool visitAssertStatement(AssertStatement node) => node.condition.accept(this);
|
| + bool visitAssertStatement(AssertStatement node) => _nodeExits(node.condition);
|
|
|
| @override
|
| - bool visitAssignmentExpression(AssignmentExpression node) => node.leftHandSide.accept(this) || node.rightHandSide.accept(this);
|
| + bool visitAssignmentExpression(AssignmentExpression node) => _nodeExits(node.leftHandSide) || _nodeExits(node.rightHandSide);
|
|
|
| @override
|
| bool visitBinaryExpression(BinaryExpression node) {
|
| @@ -12040,14 +12098,14 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| }
|
| }
|
| Expression rhsExpression = node.rightOperand;
|
| - return (lhsExpression != null && lhsExpression.accept(this)) || (rhsExpression != null && rhsExpression.accept(this));
|
| + return _nodeExits(lhsExpression) || _nodeExits(rhsExpression);
|
| }
|
|
|
| @override
|
| bool visitBlock(Block node) => _visitStatements(node.statements);
|
|
|
| @override
|
| - bool visitBlockFunctionBody(BlockFunctionBody node) => node.block.accept(this);
|
| + bool visitBlockFunctionBody(BlockFunctionBody node) => _nodeExits(node.block);
|
|
|
| @override
|
| bool visitBreakStatement(BreakStatement node) {
|
| @@ -12056,13 +12114,7 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| }
|
|
|
| @override
|
| - bool visitCascadeExpression(CascadeExpression node) {
|
| - Expression target = node.target;
|
| - if (target.accept(this)) {
|
| - return true;
|
| - }
|
| - return _visitExpressions(node.cascadeSections);
|
| - }
|
| + bool visitCascadeExpression(CascadeExpression node) => _nodeExits(node.target) || _visitExpressions(node.cascadeSections);
|
|
|
| @override
|
| bool visitConditionalExpression(ConditionalExpression node) {
|
| @@ -12071,7 +12123,7 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| Expression elseStatement = node.elseExpression;
|
| // TODO(jwren) Do we want to take constant expressions into account, evaluate if(false) {}
|
| // differently than if(<condition>), when <condition> evaluates to a constant false value?
|
| - if (conditionExpression.accept(this)) {
|
| + if (_nodeExits(conditionExpression)) {
|
| return true;
|
| }
|
| if (thenStatement == null || elseStatement == null) {
|
| @@ -12089,7 +12141,7 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| _enclosingBlockContainsBreak = false;
|
| try {
|
| Expression conditionExpression = node.condition;
|
| - if (conditionExpression.accept(this)) {
|
| + if (_nodeExits(conditionExpression)) {
|
| return true;
|
| }
|
| // TODO(jwren) Do we want to take all constant expressions into account?
|
| @@ -12097,7 +12149,7 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| BooleanLiteral booleanLiteral = conditionExpression;
|
| // If do {} while (true), and the body doesn't return or the body doesn't have a break, then
|
| // return true.
|
| - bool blockReturns = node.body.accept(this);
|
| + bool blockReturns = _nodeExits(node.body);
|
| if (booleanLiteral.value && (blockReturns || !_enclosingBlockContainsBreak)) {
|
| return true;
|
| }
|
| @@ -12112,14 +12164,14 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| bool visitEmptyStatement(EmptyStatement node) => false;
|
|
|
| @override
|
| - bool visitExpressionStatement(ExpressionStatement node) => node.expression.accept(this);
|
| + bool visitExpressionStatement(ExpressionStatement node) => _nodeExits(node.expression);
|
|
|
| @override
|
| bool visitForEachStatement(ForEachStatement node) {
|
| bool outerBreakValue = _enclosingBlockContainsBreak;
|
| _enclosingBlockContainsBreak = false;
|
| try {
|
| - return node.iterator.accept(this);
|
| + return _nodeExits(node.iterator);
|
| } finally {
|
| _enclosingBlockContainsBreak = outerBreakValue;
|
| }
|
| @@ -12133,11 +12185,11 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| if (node.variables != null && _visitVariableDeclarations(node.variables.variables)) {
|
| return true;
|
| }
|
| - if (node.initialization != null && node.initialization.accept(this)) {
|
| + if (node.initialization != null && _nodeExits(node.initialization)) {
|
| return true;
|
| }
|
| Expression conditionExpression = node.condition;
|
| - if (conditionExpression != null && conditionExpression.accept(this)) {
|
| + if (conditionExpression != null && _nodeExits(conditionExpression)) {
|
| return true;
|
| }
|
| if (_visitExpressions(node.updaters)) {
|
| @@ -12148,7 +12200,7 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| // break, then return true.
|
| bool implicitOrExplictTrue = conditionExpression == null || (conditionExpression is BooleanLiteral && conditionExpression.value);
|
| if (implicitOrExplictTrue) {
|
| - bool blockReturns = node.body.accept(this);
|
| + bool blockReturns = _nodeExits(node.body);
|
| if (blockReturns || !_enclosingBlockContainsBreak) {
|
| return true;
|
| }
|
| @@ -12167,7 +12219,7 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
|
|
| @override
|
| bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
|
| - if (node.function.accept(this)) {
|
| + if (_nodeExits(node.function)) {
|
| return true;
|
| }
|
| return node.argumentList.accept(this);
|
| @@ -12181,7 +12233,7 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| Expression conditionExpression = node.condition;
|
| Statement thenStatement = node.thenStatement;
|
| Statement elseStatement = node.elseStatement;
|
| - if (conditionExpression.accept(this)) {
|
| + if (_nodeExits(conditionExpression)) {
|
| return true;
|
| }
|
| // TODO(jwren) Do we want to take all constant expressions into account?
|
| @@ -12189,32 +12241,32 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| BooleanLiteral booleanLiteral = conditionExpression;
|
| if (booleanLiteral.value) {
|
| // if(true) ...
|
| - return thenStatement.accept(this);
|
| + return _nodeExits(thenStatement);
|
| } else if (elseStatement != null) {
|
| // if (false) ...
|
| - return elseStatement.accept(this);
|
| + return _nodeExits(elseStatement);
|
| }
|
| }
|
| if (thenStatement == null || elseStatement == null) {
|
| return false;
|
| }
|
| - return thenStatement.accept(this) && elseStatement.accept(this);
|
| + return _nodeExits(thenStatement) && _nodeExits(elseStatement);
|
| }
|
|
|
| @override
|
| bool visitIndexExpression(IndexExpression node) {
|
| Expression target = node.realTarget;
|
| - if (target != null && target.accept(this)) {
|
| + if (_nodeExits(target)) {
|
| return true;
|
| }
|
| - if (node.index.accept(this)) {
|
| + if (_nodeExits(node.index)) {
|
| return true;
|
| }
|
| return false;
|
| }
|
|
|
| @override
|
| - bool visitInstanceCreationExpression(InstanceCreationExpression node) => node.argumentList.accept(this);
|
| + bool visitInstanceCreationExpression(InstanceCreationExpression node) => _nodeExits(node.argumentList);
|
|
|
| @override
|
| bool visitIsExpression(IsExpression node) => node.expression.accept(this);
|
| @@ -12234,7 +12286,7 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| if (target != null && target.accept(this)) {
|
| return true;
|
| }
|
| - return node.argumentList.accept(this);
|
| + return _nodeExits(node.argumentList);
|
| }
|
|
|
| @override
|
| @@ -12310,11 +12362,11 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
|
|
| @override
|
| bool visitTryStatement(TryStatement node) {
|
| - if (node.body.accept(this)) {
|
| + if (_nodeExits(node.body)) {
|
| return true;
|
| }
|
| Block finallyBlock = node.finallyBlock;
|
| - if (finallyBlock != null && finallyBlock.accept(this)) {
|
| + if (_nodeExits(finallyBlock)) {
|
| return true;
|
| }
|
| return false;
|
| @@ -12371,6 +12423,19 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
|
| }
|
| }
|
|
|
| + /**
|
| + * Return `true` if the given node exits.
|
| + *
|
| + * @param node the node being tested
|
| + * @return `true` if the given node exits
|
| + */
|
| + bool _nodeExits(AstNode node) {
|
| + if (node == null) {
|
| + return false;
|
| + }
|
| + return node.accept(this);
|
| + }
|
| +
|
| bool _visitExpressions(NodeList<Expression> expressions) {
|
| for (int i = expressions.length - 1; i >= 0; i--) {
|
| if (expressions[i].accept(this)) {
|
| @@ -12778,9 +12843,9 @@ class HtmlUnitBuilder implements ht.XmlVisitor<Object> {
|
| script.scriptLibrary = library;
|
| _resolvedLibraries.addAll(resolver.resolvedLibraries);
|
| _errorListener.addAll(resolver.errorListener);
|
| - } on AnalysisException catch (exception) {
|
| + } on AnalysisException catch (exception, stackTrace) {
|
| //TODO (danrubel): Handle or forward the exception
|
| - AnalysisEngine.instance.logger.logError2("Could not resolve script tag", exception);
|
| + AnalysisEngine.instance.logger.logError2("Could not resolve script tag", new CaughtException(exception, stackTrace));
|
| }
|
| node.scriptElement = script;
|
| _scripts.add(script);
|
| @@ -13328,7 +13393,7 @@ class IncrementalResolver {
|
| AstNode rootNode = _findResolutionRoot(node);
|
| Scope scope = ScopeBuilder.scopeFor(rootNode, _errorListener);
|
| if (_elementModelChanged(rootNode.parent)) {
|
| - throw new AnalysisException.con1("Cannot resolve node: element model changed");
|
| + throw new AnalysisException("Cannot resolve node: element model changed");
|
| }
|
| _resolveTypes(node, scope);
|
| _resolveVariables(node, scope);
|
| @@ -13355,7 +13420,7 @@ class IncrementalResolver {
|
| bool _elementModelChanged(AstNode node) {
|
| Element element = _getElement(node);
|
| if (element == null) {
|
| - throw new AnalysisException.con1("Cannot resolve node: a ${node.runtimeType.toString()} does not define an element");
|
| + throw new AnalysisException("Cannot resolve node: a ${node.runtimeType.toString()} does not define an element");
|
| }
|
| DeclarationMatcher matcher = new DeclarationMatcher();
|
| return !matcher.matches(node, element);
|
| @@ -13377,7 +13442,7 @@ class IncrementalResolver {
|
| parent = result.parent;
|
| }
|
| if (parent == null) {
|
| - throw new AnalysisException.con1("Cannot resolve node: no resolvable node");
|
| + throw new AnalysisException("Cannot resolve node: no resolvable node");
|
| }
|
| return result;
|
| }
|
| @@ -14551,8 +14616,8 @@ class Library {
|
| if (_libraryElement == null) {
|
| try {
|
| _libraryElement = _analysisContext.computeLibraryElement(librarySource) as LibraryElementImpl;
|
| - } on AnalysisException catch (exception) {
|
| - AnalysisEngine.instance.logger.logError2("Could not compute library element for ${librarySource.fullName}", exception);
|
| + } on AnalysisException catch (exception, stackTrace) {
|
| + AnalysisEngine.instance.logger.logError2("Could not compute library element for ${librarySource.fullName}", new CaughtException(exception, stackTrace));
|
| }
|
| }
|
| return _libraryElement;
|
| @@ -15196,7 +15261,7 @@ class LibraryResolver {
|
| // This will be true unless the library being analyzed is the core library.
|
| _coreLibrary = createLibrary(_coreLibrarySource);
|
| if (_coreLibrary == null) {
|
| - throw new AnalysisException.con1("Core library does not exist");
|
| + throw new AnalysisException("Core library does not exist");
|
| }
|
| }
|
| instrumentation.metric3("createLibrary", "complete");
|
| @@ -15223,7 +15288,7 @@ class LibraryResolver {
|
| instrumentation.metric3("buildElementModels", "complete");
|
| LibraryElement coreElement = _coreLibrary.libraryElement;
|
| if (coreElement == null) {
|
| - throw new AnalysisException.con1("Could not resolve dart:core");
|
| + throw new AnalysisException("Could not resolve dart:core");
|
| }
|
| _buildDirectiveModels();
|
| instrumentation.metric3("buildDirectiveModels", "complete");
|
| @@ -15280,7 +15345,7 @@ class LibraryResolver {
|
| // This will be true unless the library being analyzed is the core library.
|
| _coreLibrary = _createLibraryOrNull(_coreLibrarySource);
|
| if (_coreLibrary == null) {
|
| - throw new AnalysisException.con1("Core library does not exist");
|
| + throw new AnalysisException("Core library does not exist");
|
| }
|
| }
|
| instrumentation.metric3("createLibrary", "complete");
|
| @@ -15307,7 +15372,7 @@ class LibraryResolver {
|
| instrumentation.metric3("buildElementModels", "complete");
|
| LibraryElement coreElement = _coreLibrary.libraryElement;
|
| if (coreElement == null) {
|
| - throw new AnalysisException.con1("Could not resolve dart:core");
|
| + throw new AnalysisException("Could not resolve dart:core");
|
| }
|
| _buildDirectiveModels();
|
| instrumentation.metric3("buildDirectiveModels", "complete");
|
| @@ -15760,8 +15825,8 @@ class LibraryResolver {
|
| if (unit != null) {
|
| computer.add(unit);
|
| }
|
| - } on AnalysisException catch (exception) {
|
| - AnalysisEngine.instance.logger.logError2("Internal Error: Could not access AST for ${source.fullName} during constant evaluation", exception);
|
| + } on AnalysisException catch (exception, stackTrace) {
|
| + AnalysisEngine.instance.logger.logError2("Internal Error: Could not access AST for ${source.fullName} during constant evaluation", new CaughtException(exception, stackTrace));
|
| }
|
| }
|
| }
|
| @@ -15955,7 +16020,7 @@ class LibraryResolver2 {
|
| instrumentation.metric3("buildElementModels", "complete");
|
| LibraryElement coreElement = _coreLibrary.libraryElement;
|
| if (coreElement == null) {
|
| - throw new AnalysisException.con1("Could not resolve dart:core");
|
| + throw new AnalysisException("Could not resolve dart:core");
|
| }
|
| _buildDirectiveModels();
|
| instrumentation.metric3("buildDirectiveModels", "complete");
|
| @@ -19080,14 +19145,14 @@ class ScopeBuilder {
|
| */
|
| static Scope scopeFor(AstNode node, AnalysisErrorListener errorListener) {
|
| if (node == null) {
|
| - throw new AnalysisException.con1("Cannot create scope: node is null");
|
| + throw new AnalysisException("Cannot create scope: node is null");
|
| } else if (node is CompilationUnit) {
|
| ScopeBuilder builder = new ScopeBuilder(errorListener);
|
| return builder._scopeForAstNode(node);
|
| }
|
| AstNode parent = node.parent;
|
| if (parent == null) {
|
| - throw new AnalysisException.con1("Cannot create scope: node is not part of a CompilationUnit");
|
| + throw new AnalysisException("Cannot create scope: node is not part of a CompilationUnit");
|
| }
|
| ScopeBuilder builder = new ScopeBuilder(errorListener);
|
| return builder._scopeForAstNode(parent);
|
| @@ -19123,25 +19188,25 @@ class ScopeBuilder {
|
| }
|
| AstNode parent = node.parent;
|
| if (parent == null) {
|
| - throw new AnalysisException.con1("Cannot create scope: node is not part of a CompilationUnit");
|
| + throw new AnalysisException("Cannot create scope: node is not part of a CompilationUnit");
|
| }
|
| Scope scope = _scopeForAstNode(parent);
|
| if (node is ClassDeclaration) {
|
| ClassElement element = node.element;
|
| if (element == null) {
|
| - throw new AnalysisException.con1("Cannot build a scope for an unresolved class");
|
| + throw new AnalysisException("Cannot build a scope for an unresolved class");
|
| }
|
| scope = new ClassScope(scope, element);
|
| } else if (node is ClassTypeAlias) {
|
| ClassElement element = node.element;
|
| if (element == null) {
|
| - throw new AnalysisException.con1("Cannot build a scope for an unresolved class type alias");
|
| + throw new AnalysisException("Cannot build a scope for an unresolved class type alias");
|
| }
|
| scope = new ClassScope(scope, element);
|
| } else if (node is ConstructorDeclaration) {
|
| ConstructorElement element = node.element;
|
| if (element == null) {
|
| - throw new AnalysisException.con1("Cannot build a scope for an unresolved constructor");
|
| + throw new AnalysisException("Cannot build a scope for an unresolved constructor");
|
| }
|
| FunctionScope functionScope = new FunctionScope(scope, element);
|
| functionScope.defineParameters();
|
| @@ -19149,7 +19214,7 @@ class ScopeBuilder {
|
| } else if (node is FunctionDeclaration) {
|
| ExecutableElement element = node.element;
|
| if (element == null) {
|
| - throw new AnalysisException.con1("Cannot build a scope for an unresolved function");
|
| + throw new AnalysisException("Cannot build a scope for an unresolved function");
|
| }
|
| FunctionScope functionScope = new FunctionScope(scope, element);
|
| functionScope.defineParameters();
|
| @@ -19159,7 +19224,7 @@ class ScopeBuilder {
|
| } else if (node is MethodDeclaration) {
|
| ExecutableElement element = node.element;
|
| if (element == null) {
|
| - throw new AnalysisException.con1("Cannot build a scope for an unresolved method");
|
| + throw new AnalysisException("Cannot build a scope for an unresolved method");
|
| }
|
| FunctionScope functionScope = new FunctionScope(scope, element);
|
| functionScope.defineParameters();
|
| @@ -19171,11 +19236,11 @@ class ScopeBuilder {
|
| Scope _scopeForCompilationUnit(CompilationUnit node) {
|
| CompilationUnitElement unitElement = node.element;
|
| if (unitElement == null) {
|
| - throw new AnalysisException.con1("Cannot create scope: compilation unit is not resolved");
|
| + throw new AnalysisException("Cannot create scope: compilation unit is not resolved");
|
| }
|
| LibraryElement libraryElement = unitElement.library;
|
| if (libraryElement == null) {
|
| - throw new AnalysisException.con1("Cannot create scope: compilation unit is not part of a library");
|
| + throw new AnalysisException("Cannot create scope: compilation unit is not part of a library");
|
| }
|
| return new LibraryScope(libraryElement, _errorListener);
|
| }
|
|
|