}
}
public int coerceFromRef(int level, SyntacticElement elem, int register,
Environment environment) {
Type type = elem.attribute(Attribute.Type.class).type;
if (type instanceof Type.Ref) {
Type.Ref refType = (Type.Ref) type;
Type element = refType.element();
int result = environment.allocate(element);
String cast = type2JavaType(element);
String body = "automaton.get(r" + register + ")";
// special case needed for booleans
if (element instanceof Type.Bool) {