We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d5f2d4 commit a45a2b3Copy full SHA for a45a2b3
compiler/src/dotty/tools/dotc/transform/IsInstanceOfChecker.scala
@@ -80,7 +80,7 @@ object Checkable {
80
def replaceX(implicit ctx: Context) = new TypeMap {
81
def apply(tp: Type) = tp match {
82
case tref: TypeRef
83
- if !tref.typeSymbol.isClass && tref.symbol.is(Case) =>
+ if isPatternTypeSymbol(tref.typeSymbol) =>
84
if (variance == 1) tref.info.hiBound
85
else if (variance == -1) tref.info.loBound
86
else OrType(defn.AnyType, defn.NothingType)
tests/neg-custom-args/isInstanceOf/3324h.scala
@@ -2,7 +2,7 @@ object Test {
2
trait Marker
3
def foo[T](x: T) = x match {
4
case _: (T & Marker) => // no warning
5
- // case _: T with Marker => // scalac emits a warning
+ case _: T with Marker => // scalac emits a warning
6
case _ =>
7
}
8
0 commit comments