Skip to content

Issues with unapply signature help #15248

Closed
@tgodzik

Description

@tgodzik

Compiler version

3.2.0-RC1-bin-20220519-ee9cc8f-NIGHTLY

Minimized code

  1. Actual unapply invocation.
object And {
  def unapply[A](a: A): Some[(A, A)] = Some((a, a))
}
object a {
  And.unapply(@@)
}
  1. Option returned in unapply.
object OpenBrowserCommand {
  def unapply(command: String): Option[Option[Int]] = {
    Some(Some(1))
  }

  "" match {
    case OpenBrowserCommand(@@) =>
  }
}
  1. Unknown type
case class Two[T](a: T, b: T)
object Main {
  (null: Any) match {
    case Two(@@) =>
  }
}

Output

(A, A)
 ^
(String)
 ^^^^^^
(a: T$1, b: T$1)
 ^^^^^^

Expectation

unapply[A](a: A): Some[(A, A)]
           ^^^^
(Option[Int])
 ^^^^^^^^^^^
(Any, Any)
 ^^^

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions