Package com.google.dart.engine.error

Examples of com.google.dart.engine.error.ErrorCode


        }
      }

      if (staticType.isVoid() || doesntHaveProxy(staticOrPropagatedEnclosingElt)) {
        if (propertyName.inSetterContext()) {
          ErrorCode staticErrorCode = isStaticProperty && !staticType.isVoid()
              ? StaticWarningCode.UNDEFINED_SETTER : StaticTypeWarningCode.UNDEFINED_SETTER;
          ErrorCode errorCode = shouldReportMissingMember_static ? staticErrorCode
              : HintCode.UNDEFINED_SETTER;
          resolver.reportErrorForNode(errorCode, propertyName, propertyName.getName(), displayName);
        } else if (propertyName.inGetterContext()) {
          ErrorCode staticErrorCode = isStaticProperty && !staticType.isVoid()
              ? StaticWarningCode.UNDEFINED_GETTER : StaticTypeWarningCode.UNDEFINED_GETTER;
          ErrorCode errorCode = shouldReportMissingMember_static ? staticErrorCode
              : HintCode.UNDEFINED_GETTER;
          resolver.reportErrorForNode(errorCode, propertyName, propertyName.getName(), displayName);
        } else {
          resolver.reportErrorForNode(
              StaticWarningCode.UNDEFINED_IDENTIFIER,
View Full Code Here


    super.visitClassDeclaration(node);

    ClassElementImpl classElement = getClassElement(node.getName());
    InterfaceType superclassType = null;
    if (extendsClause != null) {
      ErrorCode errorCode = withClause == null ? CompileTimeErrorCode.EXTENDS_NON_CLASS
          : CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS;
      superclassType = resolveType(
          extendsClause.getSuperclass(),
          errorCode,
          CompileTimeErrorCode.EXTENDS_ENUM,
View Full Code Here

  @Override
  public Void visitClassTypeAlias(ClassTypeAlias node) {
    super.visitClassTypeAlias(node);
    ClassElementImpl classElement = getClassElement(node.getName());
    ErrorCode errorCode = CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS;
    InterfaceType superclassType = resolveType(
        node.getSuperclass(),
        errorCode,
        CompileTimeErrorCode.EXTENDS_ENUM,
        errorCode);
View Full Code Here

      } else if (isTypeNameInAsExpression(node)) {
        reportErrorForNode(StaticWarningCode.CAST_TO_NON_TYPE, typeName, typeName.getName());
      } else if (isTypeNameInIsExpression(node)) {
        reportErrorForNode(StaticWarningCode.TYPE_TEST_NON_TYPE, typeName, typeName.getName());
      } else if ((redirectingConstructorKind = getRedirectingConstructorKind(node)) != null) {
        ErrorCode errorCode = redirectingConstructorKind == RedirectingConstructorKind.CONST
            ? CompileTimeErrorCode.REDIRECT_TO_NON_CLASS : StaticWarningCode.REDIRECT_TO_NON_CLASS;
        reportErrorForNode(errorCode, typeName, typeName.getName());
      } else if (isTypeNameInTypeArgumentList(node)) {
        reportErrorForNode(
            StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT,
            typeName,
            typeName.getName());
      } else {
        reportErrorForNode(StaticWarningCode.UNDEFINED_CLASS, typeName, typeName.getName());
      }
      elementValid = false;
    }
    if (!elementValid) {
      if (element instanceof MultiplyDefinedElement) {
        setElement(typeName, element);
      } else {
        setElement(typeName, dynamicType.getElement());
      }
      typeName.setStaticType(dynamicType);
      node.setType(dynamicType);
      return null;
    }
    Type type = null;
    if (element instanceof ClassElement) {
      setElement(typeName, element);
      type = ((ClassElement) element).getType();
    } else if (element instanceof FunctionTypeAliasElement) {
      setElement(typeName, element);
      type = ((FunctionTypeAliasElement) element).getType();
    } else if (element instanceof TypeParameterElement) {
      setElement(typeName, element);
      type = ((TypeParameterElement) element).getType();
      if (argumentList != null) {
        // Type parameters cannot have type arguments.
        // TODO(brianwilkerson) Report this error.
//      resolver.reportError(ResolverErrorCode.?, keyType);
      }
    } else if (element instanceof MultiplyDefinedElement) {
      Element[] elements = ((MultiplyDefinedElement) element).getConflictingElements();
      type = getTypeWhenMultiplyDefined(elements);
      if (type != null) {
        node.setType(type);
      }
    } else {
      // The name does not represent a type.
      RedirectingConstructorKind redirectingConstructorKind;
      if (isTypeNameInCatchClause(node)) {
        reportErrorForNode(StaticWarningCode.NON_TYPE_IN_CATCH_CLAUSE, typeName, typeName.getName());
      } else if (isTypeNameInAsExpression(node)) {
        reportErrorForNode(StaticWarningCode.CAST_TO_NON_TYPE, typeName, typeName.getName());
      } else if (isTypeNameInIsExpression(node)) {
        reportErrorForNode(StaticWarningCode.TYPE_TEST_NON_TYPE, typeName, typeName.getName());
      } else if ((redirectingConstructorKind = getRedirectingConstructorKind(node)) != null) {
        ErrorCode errorCode = redirectingConstructorKind == RedirectingConstructorKind.CONST
            ? CompileTimeErrorCode.REDIRECT_TO_NON_CLASS : StaticWarningCode.REDIRECT_TO_NON_CLASS;
        reportErrorForNode(errorCode, typeName, typeName.getName());
      } else if (isTypeNameInTypeArgumentList(node)) {
        reportErrorForNode(
            StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT,
View Full Code Here

              }
              directive.setElement(importElement);
              imports.add(importElement);

              if (analysisContext.computeKindOf(importedSource) != SourceKind.LIBRARY) {
                ErrorCode errorCode = importElement.isDeferred()
                    ? StaticWarningCode.IMPORT_OF_NON_LIBRARY
                    : CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY;
                errorListener.onError(new AnalysisError(
                    library.getLibrarySource(),
                    uriLiteral.getOffset(),
View Full Code Here

              }
              directive.setElement(importElement);
              imports.add(importElement);

              if (analysisContext.computeKindOf(importedSource) != SourceKind.LIBRARY) {
                ErrorCode errorCode = importElement.isDeferred()
                    ? StaticWarningCode.IMPORT_OF_NON_LIBRARY
                    : CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY;
                errorListener.onError(new AnalysisError(
                    library.getLibrarySource(),
                    uriLiteral.getOffset(),
View Full Code Here

TOP

Related Classes of com.google.dart.engine.error.ErrorCode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.