diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-11 15:18:38 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-11 15:18:38 +0100 |
commit | f120cde2985b4eca33ad5067d788b20242cb9f24 (patch) | |
tree | 3ebb6688d4ee74d5d27cf82a87c8717a4516bd09 /src | |
parent | d68e4f85e7dbddb6a42a4be202e765d445268be6 (diff) | |
download | dotty-f120cde2985b4eca33ad5067d788b20242cb9f24.tar.gz dotty-f120cde2985b4eca33ad5067d788b20242cb9f24.tar.bz2 dotty-f120cde2985b4eca33ad5067d788b20242cb9f24.zip |
Avoid cyclic references using imports.
The example is the current dotctest. import Symbols._ comes well before the definition of Symbols. Without the fix, it caused a cyclic reference error. But it seems reasonable to wait with the import until the class is fully elaborated.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 63a37ce90..817053868 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -312,7 +312,7 @@ class Typer extends Namer with Applications with Implicits { } val curImport = ctx.importInfo if (curImport != null && curImport.isRootImport && previous.exists) return previous - if (prevPrec < namedImport && (curImport ne outer.importInfo)) { + if (prevPrec < namedImport && (curImport ne outer.importInfo) && !curImport.sym.isCompleting) { val namedImp = namedImportRef(curImport.site, curImport.selectors) if (namedImp.exists) return findRef(checkNewOrShadowed(namedImp, namedImport), namedImport, ctx)(outer) |