Skip to content

Commit

Permalink
use isPatternTypeSymbol to avoid duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Mar 23, 2018
1 parent 2d5f2d4 commit a45a2b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ object Checkable {
def replaceX(implicit ctx: Context) = new TypeMap {
def apply(tp: Type) = tp match {
case tref: TypeRef
if !tref.typeSymbol.isClass && tref.symbol.is(Case) =>
if isPatternTypeSymbol(tref.typeSymbol) =>
if (variance == 1) tref.info.hiBound
else if (variance == -1) tref.info.loBound
else OrType(defn.AnyType, defn.NothingType)
Expand Down
2 changes: 1 addition & 1 deletion tests/neg-custom-args/isInstanceOf/3324h.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ object Test {
trait Marker
def foo[T](x: T) = x match {
case _: (T & Marker) => // no warning
// case _: T with Marker => // scalac emits a warning
case _: T with Marker => // scalac emits a warning
case _ =>
}

Expand Down

0 comments on commit a45a2b3

Please sign in to comment.