From aa0f345de2955819e7048984a7e5fa0acb7e8bc2 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Mon, 15 Jun 2015 11:21:06 -0700 Subject: SI-1931 Hide Predef.any2stringadd in REPL User imports that reference Predef are relocated to the top of the wrapping template so that they can hide implicits defined in Predef. Only one import from Predef is retained for special treatment. This is simple and sane. The test shows that `import Predef._` restores Predef implicits even if a user-defined term would normally be in scope. A smart `:import` command to turn off or quarantine imports explicitly would allow fine-grained control. --- test/files/jvm/interpreter.check | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/files/jvm') diff --git a/test/files/jvm/interpreter.check b/test/files/jvm/interpreter.check index 08372685d6..ce3c8062d7 100644 --- a/test/files/jvm/interpreter.check +++ b/test/files/jvm/interpreter.check @@ -30,7 +30,7 @@ scala> val four: anotherint = 4 four: anotherint = 4 scala> val bogus: anotherint = "hello" -:11: error: type mismatch; +:12: error: type mismatch; found : String("hello") required: anotherint (which expands to) Int @@ -353,7 +353,7 @@ defined class Term scala> def f(e: Exp) = e match { // non-exhaustive warning here case _:Fact => 3 } -:21: warning: match may not be exhaustive. +:22: warning: match may not be exhaustive. It would fail on the following inputs: Exp(), Term() def f(e: Exp) = e match { // non-exhaustive warning here ^ @@ -363,6 +363,6 @@ scala> :quit plusOne: (x: Int)Int res0: Int = 6 res0: String = after reset -:11: error: not found: value plusOne +:12: error: not found: value plusOne plusOne(5) // should be undefined now ^ -- cgit v1.2.3