File tree 2 files changed +28
-1
lines changed
compiler/src/dotty/tools/dotc/ast
2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -992,7 +992,9 @@ object desugar {
992
992
if (x.isEmpty)
993
993
tree match {
994
994
case Select (pre, nme.CONSTRUCTOR ) => foldOver(x, pre)
995
- case tree : RefTree if tree.name.isTypeName => tree.name.toString
995
+ case tree : RefTree =>
996
+ if tree.name.isTypeName then tree.name.toString
997
+ else s " ${tree.name}_type "
996
998
case tree : TypeDef => tree.name.toString
997
999
case tree : AppliedTypeTree if followArgs && tree.args.nonEmpty =>
998
1000
s " ${apply(x, tree.tpt)}_ ${extractArgs(tree.args)}"
Original file line number Diff line number Diff line change
1
+ package x
2
+
3
+ trait Printer [T ]:
4
+ def print (t: T ): String
5
+
6
+ extension[T ](t: T )(using Printer [T ])
7
+ def print (): String = summon[Printer [T ]].print(t)
8
+
9
+ object A
10
+
11
+ object B
12
+
13
+ given Printer [A .type ] with
14
+ def print (a: A .type ): String = " a"
15
+
16
+ given Printer [B .type ] with
17
+ def print (b: B .type ): String = " b"
18
+
19
+
20
+ object Main {
21
+
22
+ def main (args: Array [String ]): Unit =
23
+ System .out.println(B .print())
24
+
25
+ }
You can’t perform that action at this time.
0 commit comments