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 {
9
9
10
10
def precedence (operator : Name , isType : Boolean = false ): Int =
11
11
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
12
15
else {
13
16
val firstCh = operator.firstPart.head
14
17
if (isScalaLetter(firstCh)) 1
Original file line number Diff line number Diff line change @@ -32,11 +32,11 @@ scala> import scala.annotation.showAsInfix
32
32
scala> @scala.annotation.showAsInfix class Mappy[T,U]
33
33
// defined class Mappy
34
34
scala> def foo: (Int Mappy Boolean) && String = ???
35
- def foo: ( Int Mappy Boolean) && String
35
+ def foo: Int Mappy Boolean && String
36
36
scala> def foo: Int Mappy Boolean && String = ???
37
37
def foo: Int Mappy Boolean && String
38
38
scala> def foo: Int Mappy (Boolean && String) = ???
39
- def foo: Int Mappy Boolean && String
39
+ def foo: Int Mappy ( Boolean && String)
40
40
scala> @scala.annotation.showAsInfix(false) class ||[T,U]
41
41
// defined class ||
42
42
scala> def foo: Int || Boolean = ???
You can’t perform that action at this time.
0 commit comments