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

Export synthetic case class companion's apply with default parameter as extension #18715

Closed
prolativ opened this issue Oct 18, 2023 · 0 comments · Fixed by #18716
Closed

Export synthetic case class companion's apply with default parameter as extension #18715

prolativ opened this issue Oct 18, 2023 · 0 comments · Fixed by #18716

Comments

@prolativ
Copy link
Contributor

prolativ commented Oct 18, 2023

Compiler version

3.2.0, 3.4.0-RC1-bin-20231017-af6a2ef-NIGHTLY

Minimized code

case class Foo(x: Int = 0)

extension (x: Any)
  private def foo = Foo
  export foo.apply

Output

Error: Unexpected error when compiling T_3200b05eac-3b992a6ee3: 'assertion failed: foo does not have a default getter named apply$default$1'

Expectation

This should compile as it does when apply is defined explicitly in the companion object of a class, e.g.

case class Foo(x: Int = 0)
object Foo:
  def apply(x: Int = 0) = new Foo(x)

extension (x: Any)
  private def foo = Foo
  export foo.apply
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