-
Notifications
You must be signed in to change notification settings - Fork 1.1k
local variable name in function parameter shadows package name #11044
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
Comments
If you supply the braces required for "old-school" lexical scoping, scala 2 demonstrates the same correct shadowing.
I thought shadowing an inherited definition was an error now? but I get the same error message.
I must be missing something. I was going to test whether bindings introduced by package clauses also conflict with local defs. Edit: it was inherited shadowing local def, where |
yeah.. I forgot adding the curly braces in my example, sorry. I encountered this when trying to update zio lib to support scala3-M3, here: This works at least with scala 2.13, and probably also with M2, so it might be a regression somewhere. Thanks for looking into this. |
The Scala Language Specification, section 9.4 says:
which is how we handled that particular update to ZIO for 3.0.0-M3 in the dotty community build: dotty-staging/zio@c08d2b0 (the change itself is needed due to the new creator applications scheme in #10784) The |
thank you @griggt, I guess this one can be closed then, or did you discover anything else @som-snytt ? Sorry for the inconvenience! |
Thanks @griggt, I am closing this issue for the time being. |
Minimized code
Output
Expectation
should compile (it is compiling in scala 2.13)
The text was updated successfully, but these errors were encountered: