summaryrefslogtreecommitdiff
path: root/test/files/run/t9170.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2015-06-15 11:21:06 -0700
committerSom Snytt <som.snytt@gmail.com>2015-07-06 22:04:54 -0700
commitaa0f345de2955819e7048984a7e5fa0acb7e8bc2 (patch)
tree6d471a4c19baa068ba422a653b8131d56026dbac /test/files/run/t9170.scala
parent52fde52920d93325310e5544991feeea03e5c763 (diff)
downloadscala-aa0f345de2955819e7048984a7e5fa0acb7e8bc2.tar.gz
scala-aa0f345de2955819e7048984a7e5fa0acb7e8bc2.tar.bz2
scala-aa0f345de2955819e7048984a7e5fa0acb7e8bc2.zip
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.
Diffstat (limited to 'test/files/run/t9170.scala')
-rw-r--r--test/files/run/t9170.scala24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/files/run/t9170.scala b/test/files/run/t9170.scala
index d6cf516615..f39467bc25 100644
--- a/test/files/run/t9170.scala
+++ b/test/files/run/t9170.scala
@@ -8,17 +8,17 @@ object Test extends SessionTest {
def session =
"""
scala> object Y { def f[A](a: => A) = 1 ; def f[A](a: => Either[Exception, A]) = 2 }
-<console>:10: error: double definition:
-def f[A](a: => A): Int at line 10 and
-def f[A](a: => Either[Exception,A]): Int at line 10
+<console>:11: error: double definition:
+def f[A](a: => A): Int at line 11 and
+def f[A](a: => Either[Exception,A]): Int at line 11
have same type after erasure: (a: Function0)Int
object Y { def f[A](a: => A) = 1 ; def f[A](a: => Either[Exception, A]) = 2 }
^
scala> object Y { def f[A](a: => A) = 1 ; def f[A](a: => Either[Exception, A]) = 2 }
-<console>:10: error: double definition:
-def f[A](a: => A): Int at line 10 and
-def f[A](a: => Either[Exception,A]): Int at line 10
+<console>:11: error: double definition:
+def f[A](a: => A): Int at line 11 and
+def f[A](a: => Either[Exception,A]): Int at line 11
have same type after erasure: (a: Function0)Int
object Y { def f[A](a: => A) = 1 ; def f[A](a: => Either[Exception, A]) = 2 }
^
@@ -27,9 +27,9 @@ scala> object Y {
| def f[A](a: => A) = 1
| def f[A](a: => Either[Exception, A]) = 2
| }
-<console>:12: error: double definition:
-def f[A](a: => A): Int at line 11 and
-def f[A](a: => Either[Exception,A]): Int at line 12
+<console>:13: error: double definition:
+def f[A](a: => A): Int at line 12 and
+def f[A](a: => Either[Exception,A]): Int at line 13
have same type after erasure: (a: Function0)Int
def f[A](a: => Either[Exception, A]) = 2
^
@@ -44,9 +44,9 @@ object Y {
// Exiting paste mode, now interpreting.
-<console>:12: error: double definition:
-def f[A](a: => A): Int at line 11 and
-def f[A](a: => Either[Exception,A]): Int at line 12
+<console>:13: error: double definition:
+def f[A](a: => A): Int at line 12 and
+def f[A](a: => Either[Exception,A]): Int at line 13
have same type after erasure: (a: Function0)Int
def f[A](a: => Either[Exception, A]) = 2
^