Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace should unimport replaced symbol instead of shadow #376

Open
olafurpg opened this issue Sep 27, 2017 · 0 comments
Open

Replace should unimport replaced symbol instead of shadow #376

olafurpg opened this issue Sep 27, 2017 · 0 comments
Labels

Comments

@olafurpg
Copy link
Contributor

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 } }
@olafurpg olafurpg added the bug label Sep 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant