File tree 2 files changed +14
-2
lines changed
compiler/src/dotty/tools/dotc/printing 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) {
340
340
341
341
def selectorText (sel : untpd.ImportSelector ): Text =
342
342
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)
344
348
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)
346
350
val bound : Text =
347
351
if sel.bound.isEmpty then " "
348
352
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
+
1
5
def test =
2
6
object foo :
3
7
var x = 0
4
8
import foo as f // error
5
9
f.x
6
10
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