summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-10-26 16:44:52 +0000
committerMartin Odersky <odersky@gmail.com>2006-10-26 16:44:52 +0000
commitd42b02b09263d040c537e92f4d64c09d475a841f (patch)
tree397101b39c5103cd4890159766b8c55d73fcf8c2 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parentbd1dd901215b6c93fbd798800c96e0fec5b560d8 (diff)
downloadscala-d42b02b09263d040c537e92f4d64c09d475a841f.tar.gz
scala-d42b02b09263d040c537e92f4d64c09d475a841f.tar.bz2
scala-d42b02b09263d040c537e92f4d64c09d475a841f.zip
fixed problem in fix to bug783 that causes buil...
fixed problem in fix to bug783 that causes build to fail.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index e2e100b831..cd02cf0e3e 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -336,7 +336,7 @@ trait Typers requires Analyzer {
}
/** Post-process an identifier or selection node, performing the following:
- * (1) Check that non-function pattern expressions and case-factories are stable
+ * (1) Check that non-function pattern expressions are stable
* (2) Check that packages and static modules are not used as values
* (3) Turn tree type into stable type if possible and required by context.
*/
@@ -345,8 +345,7 @@ trait Typers requires Analyzer {
inferExprAlternative(tree, pt)
val sym = tree.symbol
if (tree.tpe.isError) tree
- else if (sym.isCaseFactory ||
- (mode & (PATTERNmode | FUNmode)) == PATTERNmode && tree.isTerm) { // (1)
+ else if ((mode & (PATTERNmode | FUNmode)) == PATTERNmode && tree.isTerm) { // (1)
checkStable(tree)
} else if ((mode & (EXPRmode | QUALmode)) == EXPRmode && !sym.isValue) { // (2)
errorTree(tree, ""+sym+" is not a value")
@@ -1511,7 +1510,9 @@ trait Typers requires Analyzer {
case Select(_, _) => copy.Select(tree, qual, name)
case SelectFromTypeTree(_, _) => copy.SelectFromTypeTree(tree, qual, name)
}
- stabilize(checkAccessible(tree1, sym, qual.tpe, qual), qual.tpe, mode, pt)
+ val result = stabilize(checkAccessible(tree1, sym, qual.tpe, qual), qual.tpe, mode, pt)
+ if (sym.isCaseFactory) checkStable(qual)
+ result
}
}