scala> val x = 3; def z() = x + 4
x: Int = 3
<console>:11: error: $VAL5 is already defined as value $VAL5
val $VAL5 = INSTANCE;
Everything's cool if the def is put on its own line.
This was caused by https://github.com/apache/spark/commit/d43415075b3468fe8aa56de5d2907d409bb96347 ([~prashant_]).
Multi-statement input to spark repl does not work