Skip to content

incorrect exhaustiveness warning in dotty build #2502

Closed
@smarter

Description

@smarter

Running sbt dotty-compiler-bootstrapped/compile we get:

[warn] -- [E028] Pattern Match Exhaustivity Warning: compiler/../out/bootstrap/dotty-compiler-bootstrapped/scala-0.1/src_managed/main/scala/tools/nsc/backend/jvm/BTypes.scala:337:35 
[warn] 337 |    def classOrArrayType: String = this match {
[warn]     |                                   ^^^^
[warn]     |                                   match may not be exhaustive.
[warn]     |                                   
[warn]     |                                   It would fail on: ClassBType(_)

But the match will not fail on ClassBType(_), the first case takes care of it:

    def classOrArrayType: String = this match {
      case ClassBType(internalName) => internalName
      case a: ArrayBType            => a.descriptor
    }

/cc @liufengyun

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