aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Checking.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-01-15 16:48:29 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-01-16 21:26:55 +0100
commit8e84133598f879c1cb0ad4b9faf2a90c0403536f (patch)
treec36edb75ae0579cada43f7f487c4a30b4cc1dd3c /src/dotty/tools/dotc/typer/Checking.scala
parenta4f35e2cf41dd38a35688f351510603165c6f89f (diff)
downloaddotty-8e84133598f879c1cb0ad4b9faf2a90c0403536f.tar.gz
dotty-8e84133598f879c1cb0ad4b9faf2a90c0403536f.tar.bz2
dotty-8e84133598f879c1cb0ad4b9faf2a90c0403536f.zip
Fix checkNonCyclic.
Need to also look info refined types. Need to handle case where we hit a NoCompleter again. Fixes #974 and makes MutableSortedSetFactory in stdlib compile.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Checking.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Checking.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/typer/Checking.scala b/src/dotty/tools/dotc/typer/Checking.scala
index 57032c4d9..6ded7c109 100644
--- a/src/dotty/tools/dotc/typer/Checking.scala
+++ b/src/dotty/tools/dotc/typer/Checking.scala
@@ -138,9 +138,7 @@ object Checking {
case SuperType(thistp, _) => isInteresting(thistp)
case AndType(tp1, tp2) => isInteresting(tp1) || isInteresting(tp2)
case OrType(tp1, tp2) => isInteresting(tp1) && isInteresting(tp2)
- case _: RefinedType => false
- // Note: it's important not to visit parents of RefinedTypes,
- // since otherwise spurious #Apply projections might be inserted.
+ case _: RefinedType => true
case _ => false
}
// If prefix is interesting, check info of typeref recursively, marking the referred symbol
@@ -148,10 +146,12 @@ object Checking {
// is hit again. Without this precaution we could stackoverflow here.
if (isInteresting(pre)) {
val info = tp.info
- val symInfo = tp.symbol.info
- if (tp.symbol.exists) tp.symbol.info = SymDenotations.NoCompleter
+ val sym = tp.symbol
+ if (sym.infoOrCompleter == SymDenotations.NoCompleter) throw CyclicReference(sym)
+ val symInfo = sym.info
+ if (sym.exists) sym.info = SymDenotations.NoCompleter
try checkInfo(info)
- finally if (tp.symbol.exists) tp.symbol.info = symInfo
+ finally if (sym.exists) sym.info = symInfo
}
tp
} catch {