Skip to content

Spurious unreachable/only null warning #4315

Closed
@allanrenucci

Description

@allanrenucci
import scala.concurrent.duration.{Duration, FiniteDuration}

class Test {
  def test(d: Duration) = d match {
    case finite: FiniteDuration =>
    case d =>
  }
}
-- [E120] Only null matched Warning: tests/allan/Test.scala:7:9 ----------------
7 |    case d =>
  |         ^
  |         Only null is matched. Consider using `case null =>` instead.
one warning found

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions