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

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


    if (loadLibraryFunction == null) {
      FunctionElementImpl function = new FunctionElementImpl(FunctionElement.LOAD_LIBRARY_NAME, -1);
      function.setSynthetic(true);
      function.setEnclosingElement(this);
      function.setReturnType(getLoadLibraryReturnType());
      function.setType(new FunctionTypeImpl(function));
      loadLibraryFunction = function;
    }
    return loadLibraryFunction;
  }
View Full Code Here


        int blockEnd = enclosingBlock.getOffset() + enclosingBlock.getLength();
        element.setVisibleRange(functionEnd, blockEnd - functionEnd - 1);
      }
    }

    FunctionTypeImpl type = new FunctionTypeImpl(element);
    if (functionTypesToFix != null) {
      functionTypesToFix.add(type);
    }
    element.setType(type);
View Full Code Here

    TypeParameterElement[] typeParameters = holder.getTypeParameters();
    FunctionTypeAliasElementImpl element = new FunctionTypeAliasElementImpl(aliasName);
    element.setParameters(parameters);
    element.setTypeParameters(typeParameters);

    FunctionTypeImpl type = new FunctionTypeImpl(element);
    type.setTypeArguments(createTypeParameterTypes(typeParameters));
    element.setType(type);

    currentHolder.addTypeAlias(element);
    aliasName.setStaticElement(element);
    holder.validate();
View Full Code Here

   */
  private ConstructorElement[] createDefaultConstructors(InterfaceTypeImpl interfaceType) {
    ConstructorElementImpl constructor = new ConstructorElementImpl(null);
    constructor.setSynthetic(true);
    constructor.setReturnType(interfaceType);
    FunctionTypeImpl type = new FunctionTypeImpl(constructor);
    functionTypesToFix.add(type);
    constructor.setType(type);
    return new ConstructorElement[] {constructor};
  }
View Full Code Here

      parameters[i] = parameter;
    }
    executable.setReturnType(dynamicType);
    executable.setParameters(parameters);

    FunctionTypeImpl methodType = new FunctionTypeImpl(executable);
    executable.setType(methodType);

    return executable;
  }
View Full Code Here

    // and [MultiplyInheritedPropertyAcessorElementImpl].
    ExecutableElementImpl e_out = new MethodElementImpl(e_0.getName(), 0);
    e_out.setSynthetic(true);
    e_out.setReturnType(r_out);
    e_out.setParameters(ps_out);
    e_out.setType(new FunctionTypeImpl(e_out));
    // Get NPE in [toString()] w/o this.
    e_out.setEnclosingElement(e_0.getEnclosingElement());
    return e_out;
  }
View Full Code Here

      builder.append(" was not set while trying to resolve types.");
      AnalysisEngine.getInstance().getLogger().logError(builder.toString(), new AnalysisException());
    } else {
      ClassElement definingClass = (ClassElement) element.getEnclosingElement();
      element.setReturnType(definingClass.getType());
      FunctionTypeImpl type = new FunctionTypeImpl(element);
      type.setTypeArguments(definingClass.getType().getTypeArguments());
      element.setType(type);
    }
    return null;
  }
View Full Code Here

      builder.append(getSource().getFullName());
      builder.append(" was not set while trying to resolve types.");
      AnalysisEngine.getInstance().getLogger().logError(builder.toString(), new AnalysisException());
    }
    element.setReturnType(computeReturnType(node.getReturnType()));
    FunctionTypeImpl type = new FunctionTypeImpl(element);
    ClassElement definingClass = element.getAncestor(ClassElement.class);
    if (definingClass != null) {
      type.setTypeArguments(definingClass.getType().getTypeArguments());
    }
    element.setType(type);
    return null;
  }
View Full Code Here

      builder.append(getSource().getFullName());
      builder.append(" was not set while trying to resolve types.");
      AnalysisEngine.getInstance().getLogger().logError(builder.toString(), new AnalysisException());
    }
    element.setReturnType(computeReturnType(node.getReturnType()));
    FunctionTypeImpl type = new FunctionTypeImpl(element);
    ClassElement definingClass = element.getAncestor(ClassElement.class);
    if (definingClass != null) {
      type.setTypeArguments(definingClass.getType().getTypeArguments());
    }
    element.setType(type);
    if (element instanceof PropertyAccessorElement) {
      PropertyAccessorElement accessor = (PropertyAccessorElement) element;
      PropertyInducingElementImpl variable = (PropertyInducingElementImpl) accessor.getVariable();
      if (accessor.isGetter()) {
        variable.setType(type.getReturnType());
      } else if (variable.getType() == null) {
        Type[] parameterTypes = type.getNormalParameterTypes();
        if (parameterTypes != null && parameterTypes.length > 0) {
          variable.setType(parameterTypes[0]);
        }
      }
    }
View Full Code Here

      }
      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.
      }
    } else {
      //
View Full Code Here

TOP

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

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.