Skip to content

Cannot define case class with protected constructor #5827

Closed
@Jasper-M

Description

@Jasper-M
scala> case class Foo protected(a: Int)         
1 |case class Foo protected(a: Int)
  |^
  |error overriding method apply in trait Function1 of type (v1: Int): Foo;
  |  method apply of type (a: Int): Foo has weaker access privileges; it should be public

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