summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala2
-rw-r--r--src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala2
-rw-r--r--test/files/pos/bug4188.scala6
3 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index 007c74dc3c..89e849d038 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -878,7 +878,7 @@ trait ParallelMatching extends ast.TreeDSL
case ConstantType(Constant(null)) if isRef => scrutTree OBJ_EQ NULL
case ConstantType(Constant(value)) => scrutTree MEMBER_== Literal(value)
case SingleType(NoPrefix, sym) => genEquals(sym)
- case SingleType(pre, sym) if sym.isModule => genEquals(sym)
+ case SingleType(pre, sym) if sym.isStable => genEquals(sym)
case ThisType(sym) if sym.isModule => genEquals(sym)
case _ if isMatchUnlessNull => scrutTree OBJ_NE NULL
case _ => scrutTree IS tpe
diff --git a/src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala b/src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala
index 12e10879bd..5ed7344bd8 100644
--- a/src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala
+++ b/src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala
@@ -21,7 +21,7 @@ trait TypeDebugging {
}
def dump(tp: Type): Unit = {
- println("** " + tp + " **")
+ println("** " + tp + " / " + tp.getClass + " **")
import tp._
println("typeSymbol = " + typeSymbol)
diff --git a/test/files/pos/bug4188.scala b/test/files/pos/bug4188.scala
new file mode 100644
index 0000000000..40e7d4924e
--- /dev/null
+++ b/test/files/pos/bug4188.scala
@@ -0,0 +1,6 @@
+class A {
+ object Ding
+ class B {
+ (null: Any) match { case _: Ding.type => () }
+ }
+}