scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

`Wildcard import cannot be renamed` error in REPL with given import #13038

Open xuwei-k opened 2 weeks ago

xuwei-k commented 2 weeks ago

Reproduction steps

Scala version: 2.13.15

$ scala -Xsource:3
Welcome to Scala 2.13.15 -Xsource:3.0.0 (OpenJDK 64-Bit Server VM, Java 21.0.4).
Type in expressions for evaluation. Or try :help.

scala> import Ordering.given
import Ordering.{_=>given}

scala> 2

       import Ordering.{_=>given}
                           ^
<synthetic>:2: error: Wildcard import cannot be renamed

(To diagnose errors in synthetic code, try adding `// show` to the end of your input.)
val res0: Int = 2

Problem

don't report error

som-snytt commented 2 weeks ago

It looks like the printer doesn't know how to print the import clause.