Github user retronym commented on the pull request:
https://github.com/apache/spark/pull/11410#issuecomment-196676313
Since offering review, I've found a more direct way to get to the object.
```
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_71).
Type in expressions for evaluation. Or try :help.
scala> $intp.isettings.unwrapStrings = false
$intp.isettings.unwrapStrings: Boolean = false
scala> var foo = ""
foo: String = ""
scala> foo = "2"
foo: String = 2
scala> val last = $intp.lastRequest
last: $intp.Request = Request(line=foo = "2", 1 trees)
scala> last.fullAccessPath
res1: String = $line4.$read.$iw.$iw
scala> val iw = $line4.$read.$iw.$iw
iw: $line4.$read.$iw.$iw.type = $line4.$read$$iw$$iw$@23444a36
scala>
iw.getClass.getMethods.find(_.getName.startsWith("$ires")).head.invoke(iw)
res2: Object = 2
scala> def nullIRes(x: Any) = { val cls = x.getClass;
cls.getDeclaredFields.filter(_.getName.startsWith("$ires")).foreach{fld =>
fld.setAccessible(true); fld.set(x, null)}}
nullIRes: (x: Any)Unit
scala> $intp.interpret(s"nullIRes(${last.fullAccessPath})")
res4: scala.tools.nsc.interpreter.IR.Result = Success
scala>
iw.getClass.getMethods.find(_.getName.startsWith("$ires")).head.invoke(iw)
res6: Object = null
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]