Examples of UnexpectedType


Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType

    if (subscripts.length != 1) {
      throw new UnsupportedSubscriptArity(getType(), subscripts.length, ctx.getCurrentAST());
    }
    Result<IValue> key = (Result<IValue>) subscripts[0];
    if (!key.getType().isInteger()) {
      throw new UnexpectedType(TypeFactory.getInstance().integerType(), key.getType(), ctx.getCurrentAST());
    }
    if (getValue().getValue().length() == 0) {
      throw RuntimeExceptionFactory.illegalArgument(ctx.getCurrentAST(), ctx.getStackTrace());
    }
    IInteger index = ((IInteger)key.getValue());
View Full Code Here

Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType

    }       
   
    if (nodeType.hasKeywordParameter(name)) {
      Type fieldType = nodeType.getKeywordParameterType(name);
      if (!repl.getType().isSubtypeOf(fieldType)) {
        throw new UnexpectedType(fieldType, repl.getType(), ctx.getCurrentAST());
      }
     
      return makeResult(getType(), getValue().asWithKeywordParameters().setParameter(name, repl.getValue()), ctx);
    }
    else {
      int index = nodeType.getFieldIndex(name);
      Type fieldType = nodeType.getFieldType(index);
      if (!repl.getType().isSubtypeOf(fieldType)) {
        throw new UnexpectedType(fieldType, repl.getType(), ctx.getCurrentAST());
      }

      return makeResult(getType(), getValue().set(index, repl.getValue()), ctx);
    }
  }
View Full Code Here

Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType

      super(__param1, __param2);
    }

    @Override
    public IBooleanResult buildBacktracker(IEvaluatorContext __eval) {
      throw new UnexpectedType(TF.boolType(), this
          .interpret(__eval.getEvaluator()).getType(),
          this);
    }
View Full Code Here

Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType

      super(__param1, __param2, __param3);
    }

    @Override
    public IBooleanResult buildBacktracker(IEvaluatorContext __eval) {
      throw new UnexpectedType(TF.boolType(), this
          .interpret(__eval.getEvaluator()).getType(),
          this);
    }
View Full Code Here

Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType

    }

    @Override
    public IBooleanResult buildBacktracker(IEvaluatorContext __eval) {

      throw new UnexpectedType(TF.boolType(), this
          .interpret(__eval.getEvaluator()).getType(),
          this);

    }
View Full Code Here

Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType

      super(__param1, __param2);
    }

    @Override
    public IBooleanResult buildBacktracker(IEvaluatorContext __eval) {
      throw new UnexpectedType(TF.boolType(), this
          .interpret(__eval.getEvaluator()).getType(),
          this);
    }
View Full Code Here

Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType

    }

    @Override
    public IBooleanResult buildBacktracker(IEvaluatorContext __eval) {

      throw new UnexpectedType(TF.boolType(), this
          .interpret(__eval.getEvaluator()).getType(),
          this);

    }
View Full Code Here

Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType

    }

    @Override
    public IBooleanResult buildBacktracker(IEvaluatorContext __eval) {

      throw new UnexpectedType(TF.boolType(), this
          .interpret(__eval.getEvaluator()).getType(),
          this);

    }
View Full Code Here

Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType

    // Check for null in case of void result or uninit.
    if (value != null && !value.getType().isSubtypeOf(type) && !(type instanceof NonTerminalType && value.getType() == Factory.Tree)) {
      //System.err.println(value.getType());
      //System.err.println(type);
      //System.err.println(value.getType().isSubtypeOf(type));
      throw new UnexpectedType(type, value.getType(), ctx.getCurrentAST());
    }
 
      this.type = type;
    this.iterator = iter;
    this.value = value;
View Full Code Here

Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType

            // applyRules(v.getValue()));
            r = org.rascalmpl.interpreter.result.ResultFactory
                .makeResult(declaredType, v.getValue(), __eval);
            __eval.getCurrentEnvt().storeVariable(var.getName(), r);
          } else {
            throw new UnexpectedType(declaredType,
                v.getType(), var);
          }
        } else {
          Type declaredType = typeOf(__eval.getCurrentEnvt(), true, __eval);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.