Skip to content

Missing unchecked warning for isInstanceOf checks #3324

Closed
@allanrenucci

Description

@allanrenucci

This code snippet emits a warning with scalac but not with Dotty

class Foo {
  def foo(x: Any): Boolean =
    x.isInstanceOf[List[String]]
}
Foo.scala:3: warning: non-variable type argument String in type List[String] (the underlying of List[String]) is unchecked since it is eliminated by erasure
    x.isInstanceOf[List[String]]
                  ^
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