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

Self definition shadows member within template #8784

Open
scabug opened this issue Aug 7, 2014 · 2 comments
Open

Self definition shadows member within template #8784

scabug opened this issue Aug 7, 2014 · 2 comments
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) language spec typer
Milestone

Comments

@scabug
Copy link

scabug commented Aug 7, 2014

Currently self definition shadows member within template scope:

scala> new { foo => val foo = 2; println(foo) }
$line5.$read$$iw$$iw$$anon$1@5ef50743
res2: AnyRef{val foo: Int} = $anon$1@5ef50743

This behaviour is quite surprising. I'd expect to either see a double definition error or to have template member shadow self definition in that scope.

@scabug
Copy link
Author

scabug commented Aug 7, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8784?orig=1
Reporter: @densh
Affected Versions: 2.11.0

@scabug
Copy link
Author

scabug commented Aug 8, 2014

@lrytz said:
dotc apparently does a double def error

@SethTisue SethTisue added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Oct 18, 2023
@SethTisue SethTisue added this to the Backlog milestone Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) language spec typer
Projects
None yet
Development

No branches or pull requests

2 participants