From a8926ae0b28d606e240f409adca69f1d91f45990 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 29 May 2011 21:30:29 +0000 Subject: Now :t types declarations as well as expression... Now :t types declarations as well as expressions, and cleans up the output the same way the repl does so stray unsolved type constraints don't befuddle anyone. Closes #4391, no review. --- test/files/run/repl-colon-type.scala | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/files/run/repl-colon-type.scala (limited to 'test/files/run/repl-colon-type.scala') diff --git a/test/files/run/repl-colon-type.scala b/test/files/run/repl-colon-type.scala new file mode 100644 index 0000000000..39ab580d2a --- /dev/null +++ b/test/files/run/repl-colon-type.scala @@ -0,0 +1,23 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |:type List[1, 2, 3] + |:type List(1, 2, 3) + |:type def foo[T](x: T) = List(x) + |:type val bar = List(Set(1)) + |:type lazy val bar = Set(Set(1)) + |:type def f[T >: Null, U <: String](x: T, y: U) = Set(x, y) + |:type def x = 1 ; def bar[T >: Null <: AnyRef](xyz: T) = 5 + | + |:type 5 + |:type val f = 5 + |:type lazy val f = 5 + |:type protected lazy val f = 5 + |:type def f = 5 + |:type def f() = 5 + | + |:type def g[T](xs: Set[_ <: T]) = Some(xs.head) + """.stripMargin +} + -- cgit v1.2.3