Package com.google.dart.engine.element

Examples of com.google.dart.engine.element.TypeParameterElement


    return super.visitTopLevelVariableDeclaration(node);
  }

  @Override
  public Void visitTypeParameter(TypeParameter node) {
    TypeParameterElement element = node.getElement();
    enterScope(element);
    try {
      return super.visitTypeParameter(node);
    } finally {
      exitScope();
View Full Code Here


   * @param node the type parameter to evaluate
   * @return {@code true} if and only if an error code is generated on the passed node
   * @see StaticTypeWarningCode#TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND
   */
  private boolean checkForTypeParameterSupertypeOfItsBound(TypeParameter node) {
    TypeParameterElement element = node.getElement();
    // prepare bound
    Type bound = element.getBound();
    if (bound == null) {
      return false;
    }
    // OK, type parameter is not supertype of its bound
    if (!bound.isMoreSpecificThan(element.getType())) {
      return false;
    }
    // report problem
    errorReporter.reportErrorForNode(
        StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
        node,
        element.getDisplayName());
    return true;
  }
View Full Code Here

  }

  @Override
  public Void visitTypeParameter(TypeParameter node) {
    SimpleIdentifier parameterName = node.getName();
    TypeParameterElement element = null;
    if (enclosingClass != null) {
      element = findIdentifier(enclosingClass.getTypeParameters(), parameterName);
    } else if (enclosingAlias != null) {
      element = findIdentifier(enclosingAlias.getTypeParameters(), parameterName);
    }
View Full Code Here

//      Type[] argumentTypes = interfaceTypeContext.getTypeArguments();
      TypeParameterElement[] typeParameterElements = interfaceTypeContext.getElement() != null
          ? interfaceTypeContext.getElement().getTypeParameters() : null;
      if (typeParameterElements != null) {
        for (int i = 0; i < typeParameterElements.length; i++) {
          TypeParameterElement typeParameterElement = typeParameterElements[i];
          if (returnType.getName().equals(typeParameterElement.getName())) {
            return interfaceTypeContext.getTypeArguments()[i];
          }
        }
        // TODO(jwren) troubleshoot why call to substitute doesn't work
//        Type[] parameterTypes = TypeParameterTypeImpl.getTypes(parameterElements);
View Full Code Here

TOP

Related Classes of com.google.dart.engine.element.TypeParameterElement

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.