diff options
author | Paul Phillips <paulp@improving.org> | 2011-02-11 09:34:50 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-02-11 09:34:50 +0000 |
commit | 7b7d17757177579319d2efa1fd94cea218ad8780 (patch) | |
tree | 111fd577d9a0e17c1c5cb7eee6eb8066d180a8d3 | |
parent | e9f1ccb0308f207303af2507415379c4d8dbcd6a (diff) | |
download | scala-7b7d17757177579319d2efa1fd94cea218ad8780.tar.gz scala-7b7d17757177579319d2efa1fd94cea218ad8780.tar.bz2 scala-7b7d17757177579319d2efa1fd94cea218ad8780.zip |
Fix for #4188.
It seems to arise from the changes to inner objects which make them look
like lazy vals. I am not sure this is the right change but at least
it's only about a six character diff to review. Closes #4188, review by
odersky.
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/ParallelMatching.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/TypeDebugging.scala | 2 | ||||
-rw-r--r-- | test/files/pos/bug4188.scala | 6 |
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 => () } + } +} |