Package wyvern.tools.types

Examples of wyvern.tools.types.Type.subtype()


      if (!(target instanceof Assignable))
        throw new RuntimeException("Invalid target");
      ((Assignable)target).checkAssignment(this, env);
      Type tT = target.typecheck(env, Optional.empty());
      Type vT = value.typecheck(env, Optional.of(tT));
      if (!vT.subtype(tT))
        ToolError.reportError(ErrorMessage.ACTUAL_FORMAL_TYPE_MISMATCH, this);
    } else {
      nextExpr.typecheck(env, Optional.empty());
    }
    return Unit.getInstance();
View Full Code Here


  }

  public static boolean checkCast(Obj ref, Class jClass) {
    Type javaType = javaToWyvType(jClass);
    Type wyvernType = ref.getType();
    return wyvernType.subtype(javaType);
  }



  public static boolean checkTypeCast(Type type, Class arg) {
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.