case BOOL: code.Emit(OpCodes.Conv_I4); break; case I1: code.Emit(OpCodes.Conv_I1); break; case I2: code.Emit(OpCodes.Conv_I2); break; case I4: code.Emit(OpCodes.Conv_I4); break; case I8: code.Emit(OpCodes.Conv_I8); break; case R4: code.Emit(OpCodes.Conv_R4); break; case R8: code.Emit(OpCodes.Conv_R8); break; case CHAR: code.Emit(OpCodes.Conv_U2); break; default: logErr("emitConvert: " + fromType + " => " + toType + "; fromType.isSubtypeOf(toType) = " + fromType.isSubtypeOf(toType));
case BOOL: code.Emit(OpCodes.Conv_I4); return; case I1: code.Emit(OpCodes.Conv_I1); return; case I2: code.Emit(OpCodes.Conv_I2); return; case I4: code.Emit(OpCodes.Conv_I4); return; case I8: code.Emit(OpCodes.Conv_I8); return; case R4: code.Emit(OpCodes.Conv_R4); return; case R8: code.Emit(OpCodes.Conv_R8); return; case CHAR: code.Emit(OpCodes.Conv_U2); return; case REF(Type t): if (t.IsEnum()) { assert fromType.isType(t.getUnderlyingType()); return; } break;
    private void emitConvert(MSILType fromType, MSILType toType) {	if (fromType.isSubtypeOf(toType))	    return;	switch (toType) {	case BOOL: code.Emit(OpCodes.Conv_I4); break; // TODO: is this correct/best?	case I1: code.Emit(OpCodes.Conv_I1); break;	case I2: code.Emit(OpCodes.Conv_I2); break;	case I4: code.Emit(OpCodes.Conv_I4); break;	case I8: code.Emit(OpCodes.Conv_I8); break;	case R4: code.Emit(OpCodes.Conv_R4); break;	case R8: code.Emit(OpCodes.Conv_R8); break;	case CHAR: code.Emit(OpCodes.Conv_U2); break;	default:	    logErr("emitConvert: " + fromType + " => " + toType		   + "; fromType.isSubtypeOf(toType) = "		   + fromType.isSubtypeOf(toType));	}    }