Skip to content

private[this] subverts override accessibility check #11913

@lrytz

Description

@lrytz
scala> class C { def f = 0 }
defined class C

scala> class D extends C { private[this] def f = 1 }
defined class D

scala> (new D).f
java.lang.IllegalAccessError: tried to access method D.f()I from class
  ... 28 elided

Should not compile. See the discussion at scala/scala#8810 (comment)

See also #11881

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/)good first issuehelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions