Skip to content

Self definition shadows member within template #8784

Open
@scabug

Description

@scabug

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)language spectyper

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions