Package com.google.dart.engine.type

Examples of com.google.dart.engine.type.Type


  private boolean isMoreSpecificThan(Type s, Set<Type> visitedTypes, boolean withDynamic,
      Set<TypePair> visitedTypePairs) {
    //
    // T is a type parameter and S is the upper bound of T.
    //
    Type bound = getElement().getBound();
    if (s.equals(bound)) {
      return true;
    }

    //
View Full Code Here


   * @see HintCode#IS_NOT_DOUBLE
   * @see HintCode#IS_NOT_INT
   */
  private boolean checkForIsDoubleHints(IsExpression node) {
    TypeName typeName = node.getType();
    Type type = typeName.getType();
    if (type != null && type.getElement() != null) {
      Element element = type.getElement();
      String typeNameStr = element.getName();
      LibraryElement libraryElement = element.getLibrary();
//      if (typeNameStr.equals(INT_TYPE_NAME) && libraryElement != null
//          && libraryElement.isDartCore()) {
//        if (node.getNotOperator() == null) {
View Full Code Here

        inheritanceManager,
        errorListener);
    topNameScope = resolver.pushNameScope();
    // add Scope variables - no type, no location, just to avoid warnings
    {
      Type type = typeProvider.getDynamicType();
      topNameScope.define(createLocalVariableWithName(type, "$id"));
      topNameScope.define(createLocalVariableWithName(type, "$parent"));
      topNameScope.define(createLocalVariableWithName(type, "$root"));
    }
  }
View Full Code Here

  /**
   * Defines variable for the given {@link AngularScopePropertyElement}.
   */
  private void defineTopVariable_forScopeProperty(AngularScopePropertyElement element) {
    Type type = element.getType();
    LocalVariableElementImpl variable = createLocalVariableWithName(type, element.getName());
    defineTopVariable(variable);
    variable.setToolkitObjects(new AngularElement[] {element});
  }
View Full Code Here

      builder.append("<");
      for (int i = 0; i < typeArguments.length; i++) {
        if (i != 0) {
          builder.append(", ");
        }
        Type typeArg = typeArguments[i];
        builder.append(typeArg.getDisplayName());
      }
      builder.append(">");
      name = builder.toString();
    }
    return name;
View Full Code Here

    // quick check for self
    if (type == this) {
      return this;
    }
    // dynamic
    Type dynamicType = DynamicTypeImpl.getInstance();
    if (this == dynamicType || type == dynamicType) {
      return dynamicType;
    }
    // TODO (jwren) opportunity here for a better, faster algorithm if this turns out to be a bottle-neck
    if (!(type instanceof InterfaceType)) {
View Full Code Here

        null,
        loopBody);
    new ElementBuilder(new ElementHolder()).visitDeclaredIdentifier(loopVariable);
    resolver.resolveNode(loopStatement);
    // define item variable
    Type itemType = varName.getBestType();
    {
      LocalVariableElementImpl variable = (LocalVariableElementImpl) varName.getStaticElement();
      variable.setType(itemType);
      resolver.defineVariable(variable);
    }
View Full Code Here

      Element propertyElement = ((InterfaceType) itemType).getGetter(propertyName);
      if (propertyElement != null) {
        propertyNode.setStaticElement(propertyElement);
      }
    } else {
      Type dynamicType = resolver.getTypeProvider().getDynamicType();
      propertyNode.setStaticElement(dynamicType.getElement());
      propertyNode.setStaticType(dynamicType);
    }
    // add argument
    expressions.add(propertyNode);
  }
View Full Code Here

    if (hasEqualTypeNames(arguments)) {
      int count = arguments.length;
      for (int i = 0; i < count; i++) {
        Object argument = arguments[i];
        if (argument instanceof Type) {
          Type type = (Type) argument;
          Element element = type.getElement();
          if (element == null) {
            arguments[i] = type.getDisplayName();
          } else {
            arguments[i] = element.getExtendedDisplayName(type.getDisplayName());
          }
        }
      }
    } else {
      int count = arguments.length;
View Full Code Here

      }
      LocationWithData<?> locationWithData = (LocationWithData<?>) location;
      // add type
      Object data = locationWithData.getData();
      if (data instanceof Type) {
        Type type = (Type) data;
        types.add(type);
      }
    }
    // done
    return types;
View Full Code Here

TOP

Related Classes of com.google.dart.engine.type.Type

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.