summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-02-04 08:29:20 +0000
committerPaul Phillips <paulp@improving.org>2011-02-04 08:29:20 +0000
commit25a2d721899881ff8dde28d6975648a0bad769f5 (patch)
tree7f697a0dd0cce0c0acc51a80e39af786091c80bb /test/files/run
parent9dc772f1636e181b3d038eba9ae2f5d1a8359386 (diff)
downloadscala-25a2d721899881ff8dde28d6975648a0bad769f5.tar.gz
scala-25a2d721899881ff8dde28d6975648a0bad769f5.tar.bz2
scala-25a2d721899881ff8dde28d6975648a0bad769f5.zip
After discovering #3376 was fixed I gave in and...
After discovering #3376 was fixed I gave in and tried to write a test. Now that the fiddling is over you can write repl tests without creating 5000 streams and settings. Look at test/files/run/bug3376.scala or jvm/interpreter.scala to see. Test case closes #3376, no review.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/bug3376.check13
-rw-r--r--test/files/run/bug3376.scala16
2 files changed, 29 insertions, 0 deletions
diff --git a/test/files/run/bug3376.check b/test/files/run/bug3376.check
new file mode 100644
index 0000000000..7286096022
--- /dev/null
+++ b/test/files/run/bug3376.check
@@ -0,0 +1,13 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+scala> defined class M
+
+scala> m1: M[Int] = mmm
+
+scala> m2: M[Float] = mmm
+
+scala> m3: M[String] = mmm
+
+scala>
diff --git a/test/files/run/bug3376.scala b/test/files/run/bug3376.scala
new file mode 100644
index 0000000000..5cff50185c
--- /dev/null
+++ b/test/files/run/bug3376.scala
@@ -0,0 +1,16 @@
+import scala.tools.nsc.interpreter._
+
+object Test {
+ class M[@specialized T] { }
+
+ val code = """
+ |class M[@specialized T] { override def toString = "mmm" }
+ |val m1 = new M[Int]()
+ |val m2 = new M[Float]()
+ |val m3 = new M[String]()
+ |""".stripMargin
+
+ def main(args: Array[String]): Unit = {
+ (ILoop run code).lines drop 1 foreach println
+ }
+}