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

Import aliased to _ can be referenced with _. #6426

Closed
scabug opened this issue Sep 25, 2012 · 8 comments · Fixed by scala/scala#6218
Closed

Import aliased to _ can be referenced with _. #6426

scabug opened this issue Sep 25, 2012 · 8 comments · Fixed by scala/scala#6218

Comments

@scabug
Copy link

scabug commented Sep 25, 2012

scala> import collection.{mutable => _, _}; `_`.Buffer(0)
import collection.{mutable=>_, _}
res0: scala.collection.mutable.Buffer[Int] = ArrayBuffer(0)
@scabug
Copy link
Author

scabug commented Sep 25, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6426?orig=1
Reporter: @retronym
Affected Versions: 2.9.2

@scabug
Copy link
Author

scabug commented Nov 3, 2012

@paulp said:
scala/scala@b5e3eafabe

@scabug
Copy link
Author

scabug commented Jan 22, 2013

@adriaanm said:
reopening for 2.10.1-RC1 backport

@scabug
Copy link
Author

scabug commented Feb 1, 2013

@JamesIry said:
scala/scala#2015

@scabug
Copy link
Author

scabug commented Jul 25, 2013

Travis Brown (travisbrown) said:
The fix ("wildcard invalid as backquoted identifier") unfortunately breaks interoperability with Java, where a single underscore is a perfectly valid identifier.

See this question for some additional discussion: http://stackoverflow.com/q/17863794/334519

@scabug
Copy link
Author

scabug commented Dec 10, 2013

@adriaanm said:
I agree that was the wrong fix. We should've changed the name under which those hidden imports are entered, not make _ illegal.
Reverting.

@scabug
Copy link
Author

scabug commented Dec 10, 2013

@adriaanm said (edited on Dec 11, 2013 9:20:44 PM UTC):
Reverted original fix because it caused the regression reported by Travis: scala/scala#3261

Let's try this again for 2.11 by changing the symbol entering logic for hidden imports.

@scabug
Copy link
Author

scabug commented Oct 31, 2015

@SethTisue said:
In Java 9 _ will be a keyword, according to https://blogs.oracle.com/sundararajan/entry/underscore_is_a_keyword_in (thx @ hepin1989 for the link), so that takes care of the interop issue — in the long run only, of course!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants