Skip to content

Bug when using lambda partial function #9977

Closed
@flomebul

Description

@flomebul

Minimized code and output

$ dotr
Starting dotty REPL...
scala> val pf1: PartialFunction[AnyVal, Int] = { case n: Int => n }
1 |val pf1: PartialFunction[AnyVal, Int] = { case n: Int => n }
  |                                               ^
  |    this case is unreachable since type A1 and class Integer are unrelated

scala>

Expectation

No error in this case

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions