Skip to content

Wildcard export from non-case class #17588

Closed
@prolativ

Description

@prolativ

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 => _, *}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions