Package com.google.dart.engine.internal.type

Examples of com.google.dart.engine.internal.type.InterfaceTypeImpl


    SimpleIdentifier className = node.getName();
    ClassElementImpl element = new ClassElementImpl(className);
    TypeParameterElement[] typeParameters = holder.getTypeParameters();

    Type[] typeArguments = createTypeParameterTypes(typeParameters);
    InterfaceTypeImpl interfaceType = new InterfaceTypeImpl(element);
    interfaceType.setTypeArguments(typeArguments);
    element.setType(interfaceType);

    ConstructorElement[] constructors = holder.getConstructors();
    if (constructors.length == 0) {
      //
View Full Code Here


    element.setTypedef(true);
    TypeParameterElement[] typeParameters = holder.getTypeParameters();
    element.setTypeParameters(typeParameters);

    Type[] typeArguments = createTypeParameterTypes(typeParameters);
    InterfaceTypeImpl interfaceType = new InterfaceTypeImpl(element);
    interfaceType.setTypeArguments(typeArguments);
    element.setType(interfaceType);

    // set default constructor
    element.setConstructors(createDefaultConstructors(interfaceType));
View Full Code Here

  @Override
  public Void visitEnumDeclaration(EnumDeclaration node) {
    SimpleIdentifier enumName = node.getName();
    ClassElementImpl enumElement = new ClassElementImpl(enumName);
    enumElement.setEnum(true);
    InterfaceTypeImpl enumType = new InterfaceTypeImpl(enumElement);
    enumElement.setType(enumType);
    currentHolder.addEnum(enumElement);
    enumName.setStaticElement(enumElement);
    return super.visitEnumDeclaration(node);
  }
View Full Code Here

        return;
      }
      // Class(args)
      if (element1 instanceof ClassElement) {
        ClassElement classElement = (ClassElement) element1;
        constructor = new InterfaceTypeImpl(classElement).lookUpConstructor(null, definingLibrary);
      }
    }
    //
    // prefix.CONST or prefix.Class() or Class.CONST or Class.constructor(args)
    //
    if (nameNode1 != null && nameNode2 != null && nameNode3 == null) {
      Element element1 = nameNode1.getStaticElement();
      Element element2 = nameNode2.getStaticElement();
      // Class.CONST - not resolved yet
      if (element1 instanceof ClassElement) {
        ClassElement classElement = (ClassElement) element1;
        element2 = classElement.lookUpGetter(nameNode2.getName(), definingLibrary);
      }
      // prefix.CONST or Class.CONST
      if (element2 instanceof PropertyAccessorElement) {
        nameNode2.setStaticElement(element2);
        annotation.setElement(element2);
        resolveAnnotationElementGetter(annotation, (PropertyAccessorElement) element2);
        return;
      }
      // prefix.Class()
      if (element2 instanceof ClassElement) {
        ClassElement classElement = (ClassElement) element2;
        constructor = classElement.getUnnamedConstructor();
      }
      // Class.constructor(args)
      if (element1 instanceof ClassElement) {
        ClassElement classElement = (ClassElement) element1;
        constructor = new InterfaceTypeImpl(classElement).lookUpConstructor(
            nameNode2.getName(),
            definingLibrary);
        nameNode2.setStaticElement(constructor);
      }
    }
    //
    // prefix.Class.CONST or prefix.Class.constructor(args)
    //
    if (nameNode1 != null && nameNode2 != null && nameNode3 != null) {
      Element element2 = nameNode2.getStaticElement();
      // element2 should be ClassElement
      if (element2 instanceof ClassElement) {
        ClassElement classElement = (ClassElement) element2;
        String name3 = nameNode3.getName();
        // prefix.Class.CONST
        PropertyAccessorElement getter = classElement.lookUpGetter(name3, definingLibrary);
        if (getter != null) {
          nameNode3.setStaticElement(getter);
          annotation.setElement(element2);
          resolveAnnotationElementGetter(annotation, getter);
          return;
        }
        // prefix.Class.constructor(args)
        constructor = new InterfaceTypeImpl(classElement).lookUpConstructor(name3, definingLibrary);
        nameNode3.setStaticElement(constructor);
      }
    }
    // we need constructor
    if (constructor == null) {
View Full Code Here

            if (closureArg instanceof FunctionExpression) {
              FunctionExpression closureExpr = (FunctionExpression) closureArg;
              Type returnType = computePropagatedReturnType(closureExpr.getElement());
              if (returnType != null) {
                // prepare the type of the returned Future
                InterfaceTypeImpl newFutureType;
                if (isAsyncFutureType(returnType)) {
                  newFutureType = (InterfaceTypeImpl) returnType;
                } else {
                  InterfaceType futureType = (InterfaceType) targetType;
                  newFutureType = new InterfaceTypeImpl(futureType.getElement());
                  newFutureType.setTypeArguments(new Type[] {returnType});
                }
                // set the 'then' invocation type
                recordPropagatedType(node, newFutureType);
                needPropagatedType = false;
                return null;
View Full Code Here

        for (int i = 0; i < parameterCount; i++) {
          typeArguments[i] = dynamicType;
        }
      }
      if (type instanceof InterfaceTypeImpl) {
        InterfaceTypeImpl interfaceType = (InterfaceTypeImpl) type;
        type = interfaceType.substitute(typeArguments);
      } else if (type instanceof FunctionTypeImpl) {
        FunctionTypeImpl functionType = (FunctionTypeImpl) type;
        type = functionType.substitute(typeArguments);
      } else {
        // TODO(brianwilkerson) Report this internal error.
View Full Code Here

TOP

Related Classes of com.google.dart.engine.internal.type.InterfaceTypeImpl

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.