diff options
author | Vlad Ureche <vlad.ureche@gmail.com> | 2016-09-14 14:06:01 +0100 |
---|---|---|
committer | Vlad Ureche <vlad.ureche@gmail.com> | 2016-09-19 20:06:29 +0200 |
commit | e60768b62151a160026985269a87fd5b63ee0ae8 (patch) | |
tree | 86eafa3b66d6f27657967075714068e16b5c79c3 /src/library | |
parent | fdb3105228db20e347a61e61e2e1d86b27683d0d (diff) | |
download | scala-e60768b62151a160026985269a87fd5b63ee0ae8.tar.gz scala-e60768b62151a160026985269a87fd5b63ee0ae8.tar.bz2 scala-e60768b62151a160026985269a87fd5b63ee0ae8.zip |
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
```
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/annotation/showAsInfix.scala | 21 |
1 files changed, 21 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..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 |