00001 00005 package edu.mit.csail.sdg.squander.spec; 00006 00007 public class IncompatibleTypesException extends TypeCheckException { 00008 00009 private static final long serialVersionUID = 9096734998607169611L; 00010 00011 private final JType t1, t2; 00012 private final String expr; 00013 private final int pos; 00014 00015 public IncompatibleTypesException(JType t1, JType t2, int pos, String expr) { 00016 super(String.format("Incompatible types: %s and %s at position %s\nin %s", t1, t2, pos, expr)); 00017 this.t1 = t1; 00018 this.t2 = t2; 00019 this.expr = expr; 00020 this.pos = pos; 00021 } 00022 00023 public JType getT1() { 00024 return t1; 00025 } 00026 00027 public JType getT2() { 00028 return t2; 00029 } 00030 00031 public String getExpr() { 00032 return expr; 00033 } 00034 00035 public int getPos() { 00036 return pos; 00037 } 00038 00039 }