public Type resolve(Environment env) {
// System.out.println("Looking at: " + this.typeName);
if (env.lookup(this.typeName) != null) {
NameBinding n = env.lookup(this.typeName);
// System.out.println("NameBinding = " + n);
// System.out.println("Its type is " + n.getType());
}
if (env.lookupType(typeName) == null) {
if (env.lookup(this.typeName) != null) {
// Perhaps its first class?
NameBinding n = env.lookup(this.typeName);
Type t = n.getType();
return t;
}
throw new RuntimeException("Cannot find "+typeName +" in environment "+env);
}
TypeBinding typeBinding = env.lookupType(typeName);