diff options
author | Burak Emir <emir@epfl.ch> | 2006-08-04 23:17:41 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2006-08-04 23:17:41 +0000 |
commit | 96bf7d6c803b20677a8fdeac59916b5fccceae99 (patch) | |
tree | 182fe15b9354f73a084573b4b0e9818da5c05eb7 /src | |
parent | 4f25b17e9f3c624e32522db1b79f64314870dad6 (diff) | |
download | scala-96bf7d6c803b20677a8fdeac59916b5fccceae99.tar.gz scala-96bf7d6c803b20677a8fdeac59916b5fccceae99.tar.bz2 scala-96bf7d6c803b20677a8fdeac59916b5fccceae99.zip |
fixed error in opt.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/PatternMatchers.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala b/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala index 72272faf82..3b63f04fdc 100644 --- a/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala +++ b/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala @@ -1057,10 +1057,12 @@ trait PatternMatchers requires (TransMatcher with PatternNodes) extends AnyRef w toTree(node.and), toTree(node.or, selector.duplicate)); case VariablePat(tree) => - val cmp = if(tree.tpe.symbol.isModuleClass) // objects are compared by eq, not == (avoids unnecessary null-magic) + val cmp = if(tree.tpe.symbol.isModuleClass && // objects are compared by eq, not == (avoids unnecessary null-magic) + selector.tpe <:< definitions.AnyRefClass.tpe) { Eq(selector.duplicate, tree) - else + } else { Equals(selector.duplicate, tree) + } return myIf( cmp, toTree(node.and), toTree(node.or, selector.duplicate)); |