From e60768b62151a160026985269a87fd5b63ee0ae8 Mon Sep 17 00:00:00 2001 From: Vlad Ureche Date: Wed, 14 Sep 2016 14:06:01 +0100 Subject: SI-4700 Add `@infix` annotation for type printing ``` scala> import scala.annotation.infix import scala.annotation.infix scala> @infix class &&[T, U] defined class $amp$amp scala> def foo: Int && Boolean = ??? foo: Int && Boolean ``` --- src/library/scala/annotation/showAsInfix.scala | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/library/scala/annotation/showAsInfix.scala (limited to 'src/library') diff --git a/src/library/scala/annotation/showAsInfix.scala b/src/library/scala/annotation/showAsInfix.scala new file mode 100644 index 0000000000..41c93b697f --- /dev/null +++ b/src/library/scala/annotation/showAsInfix.scala @@ -0,0 +1,21 @@ +package scala.annotation + +/** + * This annotation, used for two-parameter generic types makes Scala print + * the type using infix notation: + * + * ``` + * scala> class &&[T, U] + * defined class $amp$amp + * + * scala> def foo: Int && Int = ??? + * foo: &&[Int,Int] + * + * scala> @showAsInfix class &&[T, U] + * defined class $amp$amp + * + * scala> def foo: Int && Int = ??? + * foo: Int && Int + * ``` + */ +class showAsInfix extends annotation.StaticAnnotation \ No newline at end of file -- cgit v1.2.3