summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-01-09 19:39:31 +0000
committerMartin Odersky <odersky@gmail.com>2007-01-09 19:39:31 +0000
commitf75cbd338f81a00ab9696fb0482fd561ce1a0826 (patch)
treee42d6f72e23be6c823d4408c07d5fa92791c8499 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent6835f1377b16ef8d42850dade06ee840e0f2c35a (diff)
downloadscala-f75cbd338f81a00ab9696fb0482fd561ce1a0826.tar.gz
scala-f75cbd338f81a00ab9696fb0482fd561ce1a0826.tar.bz2
scala-f75cbd338f81a00ab9696fb0482fd561ce1a0826.zip
fixed bugs 880, 877, 876, 875, Added capitalize...
fixed bugs 880, 877, 876, 875, Added capitalize method to RichString
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index cc6c1dfb00..be33fb215d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -459,11 +459,10 @@ trait Typers requires Analyzer {
case Select(qual, _) => qual.tpe
case _ => NoPrefix
}
- if (tree.tpe.isInstanceOf[MethodType] && pre.isStable &&
- (pt.isStable || (mode & QUALmode) != 0 && !sym.isConstant || sym.isModule)) {
- assert(sym.tpe.paramTypes.isEmpty)
- tree.setType(MethodType(List(), singleType(pre, sym)))
- } else tree
+ if (tree.tpe.isInstanceOf[MethodType] && pre.isStable && sym.tpe.paramTypes.isEmpty &&
+ (pt.isStable || (mode & QUALmode) != 0 && !sym.isConstant || sym.isModule))
+ tree.setType(MethodType(List(), singleType(pre, sym)))
+ else tree
}
/** Perform the following adaptations of expression, pattern or type `tree' wrt to
@@ -1693,9 +1692,9 @@ trait Typers requires Analyzer {
else cx.depth - (cx.scope.nestingLevel - defEntry.owner.nestingLevel)
var impSym: Symbol = NoSymbol; // the imported symbol
var imports = context.imports; // impSym != NoSymbol => it is imported from imports.head
- while (impSym == NoSymbol && !imports.isEmpty && imports.head.depth > symDepth) {
+ while (!impSym.exists && !imports.isEmpty && imports.head.depth > symDepth) {
impSym = imports.head.importedSymbol(name)
- if (impSym == NoSymbol) imports = imports.tail
+ if (!impSym.exists) imports = imports.tail
}
// detect ambiguous definition/import,