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

unapply loses stable prefix when in pattern position #20360

Open
EugeneFlesselle opened this issue May 7, 2024 · 0 comments
Open

unapply loses stable prefix when in pattern position #20360

EugeneFlesselle opened this issue May 7, 2024 · 0 comments
Labels

Comments

@EugeneFlesselle
Copy link
Contributor

Compiler version

3.5.0-RC1

Minimized code

trait Wrap:
  type Value
  val value: Value

object Wrap:
  def unapply(w: Wrap): Some[w.Value] = Some(w.value)

object Test:
  val w: Wrap = ???

  val Some(n1) = Wrap.unapply(w)
  val _: w.Value = n1 // ok

  val Wrap(n2) = w
  val _: w.Value = n2 // Error Found: (Test.n2 : Wrap#Value)

Expectation

Expected no errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants