summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-09-10 09:40:03 -0700
committerPaul Phillips <paulp@improving.org>2012-10-09 14:17:34 -0700
commit432f9368011e0fd9e89ca0e18082bfec180baf32 (patch)
tree155dfa5932b5049ba80063c5a7758cf9c0305f0c /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parentc61c18e042d0fa41a09fea29a8dcaa2e08a40a63 (diff)
downloadscala-432f9368011e0fd9e89ca0e18082bfec180baf32.tar.gz
scala-432f9368011e0fd9e89ca0e18082bfec180baf32.tar.bz2
scala-432f9368011e0fd9e89ca0e18082bfec180baf32.zip
Experimental option -Ybreak-cycles.
Overcomes cycles encountered during classfile parsing in possibly sketchy fashion. "illegal cyclic reference involving class Foo" is the watchword. See SI-3809.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 688b4b5160..7a2c64142d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -292,8 +292,7 @@ trait Typers extends Modes with Adaptations with Tags {
*/
def checkNonCyclic(pos: Position, tp: Type): Boolean = {
def checkNotLocked(sym: Symbol) = {
- sym.initialize
- sym.lockOK || { CyclicAliasingOrSubtypingError(pos, sym); false }
+ sym.initialize.lockOK || { CyclicAliasingOrSubtypingError(pos, sym); false }
}
tp match {
case TypeRef(pre, sym, args) =>
@@ -320,7 +319,7 @@ trait Typers extends Modes with Adaptations with Tags {
}
def checkNonCyclic(pos: Position, tp: Type, lockedSym: Symbol): Boolean = try {
- if (!lockedSym.lock(CyclicReferenceError(pos, lockedSym))) false
+ if (!lockedSym.lock(CyclicReferenceError(pos, tp, lockedSym))) false
else checkNonCyclic(pos, tp)
} finally {
lockedSym.unlock()