diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java index f08853a232a46e0546c48b71bef0401322ddfc9c..5a8cf2b880851af72df41e680a1674e764c49525 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java @@ -813,13 +813,15 @@ public class RDeparse { } } else if (value instanceof TruffleObject) { Object rObject = new TruffleObjectConverter().convert((TruffleObject) value); - append("<foreign object: "); - if (rObject != null) { - appendConstant(rObject); + if (rObject == value) { + append("<foreign object>"); + } else if (rObject == null) { + append("<foreign object: null>"); } else { - append("null"); + append("<foreign object: "); + appendConstant(rObject); + append('>'); } - append('>'); } else { throw RInternalError.shouldNotReachHere("unexpected type while deparsing constant: " + value == null ? "null" : value.getClass().getSimpleName()); }