8000 SI-4700 Add `@infix` annotation for type printing by milessabin · Pull Request #5424 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

SI-4700 Add @infix annotation for type printing #5424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

milessabin
Copy link
Contributor
@milessabin milessabin commented Sep 27, 2016

Cherry pick of #5401 onto 2.11.x. All credit belong to @VladUreche.

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

@scala-jenkins scala-jenkins added this to the 2.11.9 milestone Sep 27, 2016
```
scala> import scala.annotation.infix
import scala.annotation.infix

scala> @infix class &&[T, U]
defined class $amp$amp

scala> def foo: Int && 
8000
Boolean = ???
foo: Int && Boolean
```
@milessabin milessabin force-pushed the topic/si-4700-backport branch from 5a07f14 to f30e42b Compare September 27, 2016 22:21
@paulp
Copy link
Contributor
paulp commented Oct 6, 2016

If you add this capability but do not default to printing operators infix, we will spend years with a patchwork of infix-and-not, helplessly waiting for whatever libraries turn out to lag, or worse, forking them just to print the types right.

It's so, so easy to see it coming.

Just print operators infix.

At the very (very) least, add a compiler option to do it.

@adriaanm adriaanm self-assigned this Oct 18, 2016
@SethTisue
Copy link
Member

The design and implementation need to be worked out over at #5401 first, so I don't think this is going to make 2.11.x. (@adriaanm can reopen if he disagrees)

@SethTisue SethTisue closed this Nov 10, 2016
@SethTisue SethTisue removed this from the 2.11.9 milestone Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0