File tree 3 files changed +46
-1
lines changed
compiler/src/dotty/tools/dotc/ast
3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -999,12 +999,16 @@ object desugar {
999
999
case tree : TypeDef => tree.name.toString
1000
1000
case tree : AppliedTypeTree if followArgs && tree.args.nonEmpty =>
1001
1001
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
1002
1005
case tree : LambdaTypeTree =>
1003
1006
apply(x, tree.body)
1004
1007
case tree : Tuple =>
1005
1008
extractArgs(tree.trees)
1006
1009
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"
1008
1012
case _ => foldOver(x, tree)
1009
1013
}
1010
1014
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