Skip to content

Private types should not be exposed by non-private members #997

Closed
@odersky

Description

@odersky

We should not allow a private type to appear in the signature of a non-private member.
The private type is not accessible outside the scope of the member. In a "by-name" based
system for resolving types this can lead to crashes.

Example: collection.mutable.IndexedSeqView crashes when the accessibility of the This type
is restricted from protected[this] to private[this]. The crash happens in mixin when we try to refer
to This computing the signature of filter in AbstractTransformedX, which is an inner subclass
of IndexedSeqView. It can't work because This is not visible as an inherited member of AbstractTransformedX. To prevent crashes like these we have to be stricter in the frontend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions