File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -267,5 +267,9 @@ class TypeUtils:
267
267
268
268
self.decl(nme.CONSTRUCTOR ).altsWith(isApplicable).map(_.symbol)
269
269
270
+ def showRef (using Context ): String = self match
271
+ case self : SingletonType => ctx.printer.toTextRef(self).show
272
+ case _ => self.show
273
+
270
274
end TypeUtils
271
275
Original file line number Diff line number Diff line change @@ -558,8 +558,8 @@ object Implicits:
558
558
var str1 = err.refStr(alt1.ref)
559
559
var str2 = err.refStr(alt2.ref)
560
560
if str1 == str2 then
561
- str1 = ctx.printer.toTextRef( alt1.ref).show
562
- str2 = ctx.printer.toTextRef( alt2.ref).show
561
+ str1 = alt1.ref.showRef
562
+ str2 = alt2.ref.showRef
563
563
em " both $str1 and $str2 $qualify" .withoutDisambiguation()
564
564
565
565
override def toAdd (using Context ) =
@@ -1724,7 +1724,7 @@ trait Implicits:
1724
1724
" argument"
1725
1725
1726
1726
def showResult (r : SearchResult ) = r match
1727
- case r : SearchSuccess => ctx.printer.toTextRef( r.ref).show
1727
+ case r : SearchSuccess => r.ref.showRef
1728
1728
case r => r.show
1729
1729
1730
1730
result match
Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ trait ImportSuggestions:
336
336
if ref.symbol.is(ExtensionMethod ) then
337
337
s " ${ctx.printer.toTextPrefixOf(ref).show}${ref.symbol.name}"
338
338
else
339
- ctx.printer.toTextRef( ref).show
339
+ ref.showRef
340
340
s " import $imported"
341
341
val suggestions = suggestedRefs
342
342
.zip(suggestedRefs.map(importString))
You can’t perform that action at this time.
0 commit comments