@@ -19,9 +19,9 @@ import java.net.URL
19
19
import scala .collection .mutable , mutable .ListBuffer
20
20
import scala .language .implicitConversions
21
21
import scala .reflect .{ClassTag , classTag }
22
+ import scala .reflect .internal .{FatalError , Flags , MissingRequirementError , NoPhase , Precedence }
22
23
import scala .reflect .internal .util .ScalaClassLoader .URLClassLoader
23
24
import scala .reflect .internal .util .{AbstractFileClassLoader , BatchSourceFile , ListOfNil , Position , ReplBatchSourceFile , SourceFile }
24
- import scala .reflect .internal .{FatalError , Flags , MissingRequirementError , NoPhase }
25
25
import scala .reflect .runtime .{universe => ru }
26
26
import scala .tools .nsc .{Global , Settings }
27
27
import scala .tools .nsc .interpreter .Results .{Error , Incomplete , Result , Success }
@@ -621,16 +621,14 @@ class IMain(val settings: Settings, parentClassLoaderOverride: Option[ClassLoade
621
621
override lazy val power = new Power (this , new StdReplVals (this ))(tagOfStdReplVals, classTag[StdReplVals ])
622
622
623
623
/** Here is where we:
624
- *
625
- * 1) Read some source code, and put it in the "read" object.
626
- * 2) Evaluate the read object, and put the result in the "eval" object.
627
- * 3) Create a String for human consumption, and put it in the "print" object.
628
- *
629
- * Read! Eval! Print! Some of that not yet centralized here.
630
- */
631
- class ReadEvalPrint (val lineId : Int ) {
632
- def this () = this (freshLineId())
633
-
624
+ *
625
+ * 1) Read some source code, and put it in the "read" object.
626
+ * 2) Evaluate the read object, and put the result in the "eval" object.
627
+ * 3) Create a String for human consumption, and put it in the "print" object.
628
+ *
629
+ * Read! Eval! Print! Some of that not yet centralized here.
630
+ */
631
+ class ReadEvalPrint (val lineId : Int = freshLineId()) {
634
632
val packageName = sessionNames.packageName(lineId)
635
633
val readName = sessionNames.read
636
634
val evalName = sessionNames.eval
@@ -813,6 +811,7 @@ class IMain(val settings: Settings, parentClassLoaderOverride: Option[ClassLoade
813
811
case init :+ tree =>
814
812
def loop (scrut : Tree ): Tree = scrut match {
815
813
case _ : Assign => tree
814
+ case Apply (Select (_, op), _) if Precedence (op.decoded).level == 0 => tree
816
815
case _ : RefTree | _ : TermTree => storeInVal(tree)
817
816
case Annotated (_, arg) => loop(arg)
818
817
case _ => tree
@@ -823,7 +822,7 @@ class IMain(val settings: Settings, parentClassLoaderOverride: Option[ClassLoade
823
822
}
824
823
825
824
/** handlers for each tree in this request */
826
- val handlers : List [MemberHandler ] = trees map (memberHandlers chooseHandler _ )
825
+ val handlers : List [MemberHandler ] = trees. map(memberHandlers. chooseHandler(_) )
827
826
val definesValueClass = handlers.exists(_.definesValueClass)
828
827
829
828
val isClassBased = IMain .this .isClassBased && ! definesValueClass
@@ -967,7 +966,8 @@ class IMain(val settings: Settings, parentClassLoaderOverride: Option[ClassLoade
967
966
968
967
969
968
/** Compile the object file. Returns whether the compilation succeeded.
970
- * If all goes well, the "types" map is computed. */
969
+ * If all goes well, the "types" map is computed.
970
+ */
971
971
def compile : Boolean = {
972
972
973
973
// compile the object containing the user's code
0 commit comments