} else {
adt = env.lookupAbstractDataType(name);
}
if (adt == null) {
throw new UndeclaredType(name, this);
}
String constructor = org.rascalmpl.interpreter.utils.Names
.name(this.getProduction());
Set<Type> constructors = env.lookupConstructor(adt, constructor);
if (constructors.size() == 0) {
throw new UndeclaredType(name + "." + constructor, this);
} else if (constructors.size() > 1) {
throw new AmbiguousFunctionReference(name + "."
+ constructor, this);
} else {
return constructors.iterator().next();