summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan@lightbend.com>2017-02-16 12:26:51 -0800
committerGitHub <noreply@github.com>2017-02-16 12:26:51 -0800
commite2be7c498dd849a007ab3e2a923fe48c8ae74b94 (patch)
treefad4a611d315302499dee4d1ad033c977b41d0b5 /test/files/run
parentc10d25135361e309ddfd71c6806e041e994dc6fd (diff)
parentfab1db5a3854ae737e1d749eb08be9baf41199f5 (diff)
downloadscala-e2be7c498dd849a007ab3e2a923fe48c8ae74b94.tar.gz
scala-e2be7c498dd849a007ab3e2a923fe48c8ae74b94.tar.bz2
scala-e2be7c498dd849a007ab3e2a923fe48c8ae74b94.zip
Merge pull request #5589 from allisonhb/feature/si-4700
SI-4700 The thrilling continuation to the infix type printing saga.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t4700.check44
-rw-r--r--test/files/run/t4700.scala22
2 files changed, 66 insertions, 0 deletions
diff --git a/test/files/run/t4700.check b/test/files/run/t4700.check
new file mode 100644
index 0000000000..ae854b959d
--- /dev/null
+++ b/test/files/run/t4700.check
@@ -0,0 +1,44 @@
+
+scala> import scala.annotation.showAsInfix
+import scala.annotation.showAsInfix
+
+scala> class &&[T,U]
+defined class $amp$amp
+
+scala> def foo: Int && Boolean = ???
+foo: Int && Boolean
+
+scala> def foo: Int && Boolean && String = ???
+foo: Int && Boolean && String
+
+scala> def foo: Int && (Boolean && String) = ???
+foo: Int && (Boolean && String)
+
+scala> @showAsInfix type Mappy[T, U] = Map[T, U]
+defined type alias Mappy
+
+scala> def foo: Int Mappy (Boolean && String) = ???
+foo: Int Mappy (Boolean && String)
+
+scala> @showAsInfix(false) class ||[T,U]
+defined class $bar$bar
+
+scala> def foo: Int || Boolean = ???
+foo: ||[Int,Boolean]
+
+scala> 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
new file mode 100644
index 0000000000..7c02676e89
--- /dev/null
+++ b/test/files/run/t4700.scala
@@ -0,0 +1,22 @@
+import scala.tools.nsc.interpreter._
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+ |import scala.annotation.showAsInfix
+ |class &&[T,U]
+ |def foo: Int && Boolean = ???
+ |def foo: Int && Boolean && String = ???
+ |def foo: Int && (Boolean && String) = ???
+ |@showAsInfix type Mappy[T, U] = Map[T, U]
+ |def foo: Int Mappy (Boolean && String) = ???
+ |@showAsInfix(false) class ||[T,U]
+ |def foo: Int || Boolean = ???
+ |class &:[L, R]
+ |def foo: Int &: String = ???
+ |def foo: Int &: Boolean &: String = ???
+ |def foo: (Int && String) &: Boolean = ???
+ |def foo: Int && (Boolean &: String) = ???
+ |""".stripMargin
+}
+