From 8badcadbe51f4a02e495f462f5f2666a24d79cb0 Mon Sep 17 00:00:00 2001 From: allisonhb Date: Wed, 7 Dec 2016 20:44:54 -0500 Subject: SI-4700 Show infix types with as few parentheses as needed. --- test/files/run/t4700.check | 15 +++++++++++++++ test/files/run/t4700.scala | 5 +++++ 2 files changed, 20 insertions(+) (limited to 'test/files') diff --git a/test/files/run/t4700.check b/test/files/run/t4700.check index 30f8124b85..40caf0fd36 100644 --- a/test/files/run/t4700.check +++ b/test/files/run/t4700.check @@ -29,4 +29,19 @@ defined type alias Mappy scala> def foo: Int Mappy (Boolean && String) = ??? foo: Int Mappy (Boolean && String) +scala> @showAsInfix class &:[L, R] +defined class $amp$colon + +scala> def foo: Int &: String = ??? +foo: Int &: String + +scala> def foo: Int &: Boolean &: String = ??? +foo: Int &: Boolean &: String + +scala> def foo: (Int || String) &: Boolean = ??? +foo: (Int || String) &: Boolean + +scala> def foo: Int || (Boolean &: String) = ??? +foo: Int || (Boolean &: String) + scala> :quit diff --git a/test/files/run/t4700.scala b/test/files/run/t4700.scala index 6182656b18..77f0de3d38 100644 --- a/test/files/run/t4700.scala +++ b/test/files/run/t4700.scala @@ -13,6 +13,11 @@ object Test extends ReplTest { |def foo: Int && (Boolean && String) = ??? |@showAsInfix type Mappy[T, U] = Map[T, U] |def foo: Int Mappy (Boolean && String) = ??? + |@showAsInfix class &:[L, R] + |def foo: Int &: String = ??? + |def foo: Int &: Boolean &: String = ??? + |def foo: (Int || String) &: Boolean = ??? + |def foo: Int || (Boolean &: String) = ??? |""".stripMargin } -- cgit v1.2.3