Skip to content
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

Wildcard export from non-case class #17588

Closed
prolativ opened this issue May 25, 2023 · 0 comments · Fixed by #17590
Closed

Wildcard export from non-case class #17588

prolativ opened this issue May 25, 2023 · 0 comments · Fixed by #17590

Comments

@prolativ
Copy link
Contributor

Compiler version

3.3.1-RC1-bin-20230524-5262680-NIGHTLY and before

Minimized code

class StringBox(inner: String):
  export inner.*

Output

[error] Export.scala:2:16
[error] error overriding method toString in class Any of type (): String;
[error]   method toString of type (): String cannot override since it comes from an export
[error]   export inner.*
[error]                ^

Expectation

This should compile, just as it would if the type of inner was a case class (#13234).

Currently as a workaround one has to write

class StringBox(inner: String):
  export inner.{hashCode => _, toString => _, equals => _, *}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants