summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-09-18 17:04:32 +0000
committerMartin Odersky <odersky@gmail.com>2010-09-18 17:04:32 +0000
commitbc3e3c54fba45125f3ab2e27a6add43ceaa8f49e (patch)
tree5b3c8b47908e6576ce53a05853ebf59bd5d64b0d /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent49bdf3cda2095c781effe3b1aac69ad1e1791db7 (diff)
downloadscala-bc3e3c54fba45125f3ab2e27a6add43ceaa8f49e.tar.gz
scala-bc3e3c54fba45125f3ab2e27a6add43ceaa8f49e.tar.bz2
scala-bc3e3c54fba45125f3ab2e27a6add43ceaa8f49e.zip
Better unlocking behavior when exceptions are r...
Better unlocking behavior when exceptions are raised. Review by moors.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index f793da0c54..52ea62e656 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -358,13 +358,13 @@ trait Typers { self: Analyzer =>
}
}
- def checkNonCyclic(pos: Position, tp: Type, lockedSym: Symbol): Boolean = {
+ def checkNonCyclic(pos: Position, tp: Type, lockedSym: Symbol): Boolean = try {
lockedSym.lock {
throw new TypeError("illegal cyclic reference involving " + lockedSym)
}
- val result = checkNonCyclic(pos, tp)
+ checkNonCyclic(pos, tp)
+ } finally {
lockedSym.unlock()
- result
}
def checkNonCyclic(sym: Symbol) {
@@ -697,6 +697,7 @@ trait Typers { self: Analyzer =>
/** The member with given name of given qualifier tree */
def member(qual: Tree, name: Name) = qual.tpe match {
case ThisType(clazz) if (context.enclClass.owner.hasTransOwner(clazz)) =>
+ // println("member")
qual.tpe.member(name)
case _ =>
if (phase.next.erasedTypes) qual.tpe.member(name)