summaryrefslogtreecommitdiff
path: root/src/library/scala
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 /src/library/scala
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 'src/library/scala')
-rw-r--r--src/library/scala/annotation/showAsInfix.scala27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/library/scala/annotation/showAsInfix.scala b/src/library/scala/annotation/showAsInfix.scala
new file mode 100644
index 0000000000..6c25e08efa
--- /dev/null
+++ b/src/library/scala/annotation/showAsInfix.scala
@@ -0,0 +1,27 @@
+package scala.annotation
+
+/**
+ * This annotation configures how Scala prints two-parameter generic types.
+ *
+ * By default, types with symbolic names are printed infix; while types without
+ * them are printed using the regular generic type syntax.
+ *
+ * Example of usage:
+ {{{
+ scala> class Map[T, U]
+ defined class Map
+
+ scala> def foo: Int Map Int = ???
+ foo: Map[Int,Int]
+
+ scala> @showAsInfix class Map[T, U]
+ defined class Map
+
+ scala> def foo: Int Map Int = ???
+ foo: Int Map Int
+ }}}
+ *
+ * @param enabled whether to show this type as an infix type operator.
+ * @since 2.12.2
+ */
+class showAsInfix(enabled: Boolean = true) extends annotation.StaticAnnotation \ No newline at end of file