File tree Expand file tree Collapse file tree 3 files changed +46
-1
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -999,12 +999,16 @@ object desugar {
999999 case tree : TypeDef => tree.name.toString
10001000 case tree : AppliedTypeTree if followArgs && tree.args.nonEmpty =>
10011001 s " ${apply(x, tree.tpt)}_ ${extractArgs(tree.args)}"
1002+ case InfixOp (left, op, right) =>
1003+ if followArgs then s " ${op.name}_ ${extractArgs(List (left, right))}"
1004+ else op.name.toString
10021005 case tree : LambdaTypeTree =>
10031006 apply(x, tree.body)
10041007 case tree : Tuple =>
10051008 extractArgs(tree.trees)
10061009 case tree : Function if tree.args.nonEmpty =>
1007- if (followArgs) s " ${extractArgs(tree.args)}_to_ ${apply(" " , tree.body)}" else " Function"
1010+ if followArgs then s " ${extractArgs(tree.args)}_to_ ${apply(" " , tree.body)}"
1011+ else " Function"
10081012 case _ => foldOver(x, tree)
10091013 }
10101014 else x
Original file line number Diff line number Diff line change 1+ trait Transition [From , To ]
2+
3+ infix type ==> [From , To ] = Transition [From , To ]
4+
5+ type A = A .type
6+ object A
7+
8+ type B = B .type
9+ object B
10+
11+ type C = C .type
12+ object C
13+
14+ // Compiles
15+ given (A ==> B ) = ???
16+
17+ // was Compile error
18+ given (A ==> C ) = ???
19+
20+ given ==> [A , C ] = ??? // error: double definition
21+
22+ given List [A ==> B ] = ???
23+ given List [A ==> C ] = ??? // error: double definition
Original file line number Diff line number Diff line change 1+ trait Transition [From , To ]
2+
3+ infix type ==> [From , To ] = Transition [From , To ]
4+
5+ type A = A .type
6+ object A
7+
8+ type B = B .type
9+ object B
10+
11+ type C = C .type
12+ object C
13+
14+ // Compiles
15+ given (A ==> B ) = ???
16+
17+ // was Compile error
18+ given (A ==> C ) = ???
You can’t perform that action at this time.
0 commit comments