File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/dotty/tools/dotc/parsing
test-resources/type-printer Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ package object parsing {
99
1010 def precedence (operator : Name , isType : Boolean = false ): Int =
1111 if (operator eq nme.ERROR ) - 1
12+ /* SLS 3.2.10 (https://www.scala-lang.org/files/archive/spec/2.13/03-types.html#infix-types):
13+ * all infix types have the same precedence */
14+ else if (isType) minInfixPrec
1215 else {
1316 val firstCh = operator.firstPart.head
1417 if (isScalaLetter(firstCh)) 1
Original file line number Diff line number Diff line change @@ -32,11 +32,11 @@ scala> import scala.annotation.showAsInfix
3232scala> @scala.annotation.showAsInfix class Mappy[T,U]
3333// defined class Mappy
3434scala> def foo: (Int Mappy Boolean) && String = ???
35- def foo: ( Int Mappy Boolean) && String
35+ def foo: Int Mappy Boolean && String
3636scala> def foo: Int Mappy Boolean && String = ???
3737def foo: Int Mappy Boolean && String
3838scala> def foo: Int Mappy (Boolean && String) = ???
39- def foo: Int Mappy Boolean && String
39+ def foo: Int Mappy ( Boolean && String)
4040scala> @scala.annotation.showAsInfix(false) class ||[T,U]
4141// defined class ||
4242scala> def foo: Int || Boolean = ???
You can’t perform that action at this time.
0 commit comments