Open
Description
Reported by @xeno-by , the current scheme of inserting a named import and leaving wildcard imports unchanged can produce ambiguous imports, even if named imports have higher precedence
scala> object X { class C }
defined object X
scala> object Y { class C }
defined object Y
scala> locally { import X._; import Y.C; new C }
res0: Y.C = Y$C@5ac646b3
scala> locally { import Y.C; locally { import X._; new C } }
<console>:38: error: reference to C is ambiguous;
it is imported twice in the same scope by
import X._
and import Y.C
locally { import Y.C; locally { import X._; new C } }