File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
compiler/src/dotty/tools/dotc/printing Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -340,9 +340,13 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
340340
341341 def selectorText (sel : untpd.ImportSelector ): Text =
342342 val id : Text =
343- if sel.isGiven then keywordText(" given" ) else toText(sel.imported.name)
343+ if sel.isGiven then keywordText(" given" )
344+ else sel.imported.name match
345+ case nme.WILDCARD => " *"
346+ case nme.raw.STAR => " `*`"
347+ case name => toText(name)
344348 val rename : Text =
345- if sel.renamed.isEmpty then " " else Str (" => " ) ~ toText(sel.renamed)
349+ if sel.renamed.isEmpty then " " else Str (" as " ) ~ toText(sel.renamed)
346350 val bound : Text =
347351 if sel.bound.isEmpty then " "
348352 else if sel.isGiven then Str (" " ) ~ toText(sel.bound)
Original file line number Diff line number Diff line change 1+ object a :
2+ def * = 1
3+ def other = 2
4+
15def test =
26 object foo :
37 var x = 0
48 import foo as f // error
59 f.x
610
11+ import a .`*`
12+ println(* ) // ok
13+ println(other) // error
14+ end test
You can’t perform that action at this time.
0 commit comments