Package com.google.dart.engine.ast

Examples of com.google.dart.engine.ast.TypeName


  @Override
  public Void visitVariableDeclaration(VariableDeclaration node) {
    super.visitVariableDeclaration(node);
    Type declaredType;
    TypeName typeName = ((VariableDeclarationList) node.getParent()).getType();
    if (typeName == null) {
      declaredType = dynamicType;
    } else {
      declaredType = getType(typeName);
    }
View Full Code Here


      boolean[] detectedRepeatOnIndex = new boolean[typeNames.length];
      for (int i = 0; i < detectedRepeatOnIndex.length; i++) {
        detectedRepeatOnIndex[i] = false;
      }
      for (int i = 0; i < typeNames.length; i++) {
        TypeName typeName = typeNames[i];
        if (!detectedRepeatOnIndex[i]) {
          Element element = typeName.getName().getStaticElement();
          for (int j = i + 1; j < typeNames.length; j++) {
            TypeName typeName2 = typeNames[j];
            Identifier identifier2 = typeName2.getName();
            String name2 = identifier2.getName();
            Element element2 = identifier2.getStaticElement();
            if (element != null && element.equals(element2)) {
              detectedRepeatOnIndex[j] = true;
              reportErrorForNode(CompileTimeErrorCode.IMPLEMENTS_REPEATED, typeName2, name2);
View Full Code Here

    Type staticType = dynamicType;
    TypeArgumentList typeArguments = node.getTypeArguments();
    if (typeArguments != null) {
      NodeList<TypeName> arguments = typeArguments.getArguments();
      if (arguments != null && arguments.size() == 1) {
        TypeName argumentTypeName = arguments.get(0);
        Type argumentType = getType(argumentTypeName);
        if (argumentType != null) {
          staticType = argumentType;
        }
      }
View Full Code Here

    Type staticValueType = dynamicType;
    TypeArgumentList typeArguments = node.getTypeArguments();
    if (typeArguments != null) {
      NodeList<TypeName> arguments = typeArguments.getArguments();
      if (arguments != null && arguments.size() == 2) {
        TypeName entryKeyTypeName = arguments.get(0);
        Type entryKeyType = getType(entryKeyTypeName);
        if (entryKeyType != null) {
          staticKeyType = entryKeyType;
        }
        TypeName entryValueTypeName = arguments.get(1);
        Type entryValueType = getType(entryValueTypeName);
        if (entryValueType != null) {
          staticValueType = entryValueType;
        }
      }
View Full Code Here

   *
   * @param node the function expression whose static return type is to be computed
   * @return the static return type that was computed
   */
  private Type computeStaticReturnTypeOfFunctionDeclaration(FunctionDeclaration node) {
    TypeName returnType = node.getReturnType();
    if (returnType == null) {
      return dynamicType;
    }
    return returnType.getType();
  }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.ast.TypeName

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.