Skip to content

Erasure incorrectly rewrites isInstanceOf[X & Y] as isInstanceOf[X] #2084

Closed
@smarter

Description

@smarter

It should be rewritten as isInstanceOf[X] && isInstanceOf[Y] of course.
Test case that should run without asserting:

trait X
trait Y

object Test {
  def main(args: Array[String]): Unit = {
    val x: Any = new X {}
    assert(!x.isInstanceOf[X & Y])
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions