Skip to content

Cannot define case class with protected constructor #5827

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

Closed
Jasper-M opened this issue Jan 31, 2019 · 0 comments
Closed

Cannot define case class with protected constructor #5827

Jasper-M opened this issue Jan 31, 2019 · 0 comments

Comments

@Jasper-M
Copy link
Contributor

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
nicolasstucki added a commit that referenced this issue Feb 2, 2019
Fix #5827: Don't copy protected flag to apply method of case class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant