diff options
author | Paul Phillips <paulp@improving.org> | 2012-07-15 12:16:36 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-07-21 22:12:55 -0700 |
commit | fa63170098a239ada206e74117194ae8c4dd2600 (patch) | |
tree | d23b83a6790621ea630368f7d658b3f77ae035fe /src/compiler/scala/tools/nsc/Global.scala | |
parent | e52fa7e652c175f561a1a0804e04b6d00b89aaa6 (diff) | |
download | scala-fa63170098a239ada206e74117194ae8c4dd2600.tar.gz scala-fa63170098a239ada206e74117194ae8c4dd2600.tar.bz2 scala-fa63170098a239ada206e74117194ae8c4dd2600.zip |
Removed "core classes first" logic.
I see no evidence this is necessary, and it should be wildly
uncontroversial that if we can lose this, we should. Hardcoded filenames
which don't even exist in the repository ("StandardEmbeddings.scala",
"EmbeddedControls.scala") have no place in compiler source. If some
portion of this is believed necessary then better evidence of that
should be offered.
Review by @lrytz.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 6a61beb55d..1c68b783bf 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -1498,8 +1498,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) /** Compile list of source files */ def compileSources(_sources: List[SourceFile]) { - val depSources = dependencyAnalysis calculateFiles _sources.distinct - val sources = coreClassesFirst(depSources) + val sources = dependencyAnalysis calculateFiles _sources.distinct // there is a problem already, e.g. a plugin was passed a bad option if (reporter.hasErrors) return @@ -1659,46 +1658,6 @@ class Global(var currentSettings: Settings, var reporter: Reporter) } if (!pclazz.isRoot) resetPackageClass(pclazz.owner) } - - /** - * Re-orders the source files to - * 1. This Space Intentionally Left Blank - * 2. LowPriorityImplicits / EmbeddedControls (i.e. parents of Predef) - * 3. the rest - * - * 1 is to avoid cyclic reference errors. - * 2 is due to the following. When completing "Predef" (*), typedIdent is called - * for its parents (e.g. "LowPriorityImplicits"). typedIdent checks whether - * the symbol reallyExists, which tests if the type of the symbol after running - * its completer is != NoType. - * If the "namer" phase has not yet run for "LowPriorityImplicits", the symbol - * has a SourcefileLoader as type. Calling "doComplete" on it does nothing at - * all, because the source file is part of the files to be compiled anyway. - * So the "reallyExists" test will return "false". - * Only after the namer, the symbol has a lazy type which actually computes - * the info, and "reallyExists" behaves as expected. - * So we need to make sure that the "namer" phase is run on predef's parents - * before running it on predef. - * - * (*) Predef is completed early when calling "mkAttributedRef" during the - * addition of "import Predef._" to sourcefiles. So this situation can't - * happen for user classes. - * - */ - private def coreClassesFirst(files: List[SourceFile]) = { - val goLast = 4 - def rank(f: SourceFile) = { - if (f.file.container.name != "scala") goLast - else f.file.name match { - case "LowPriorityImplicits.scala" => 2 - case "StandardEmbeddings.scala" => 2 - case "EmbeddedControls.scala" => 2 - case "Predef.scala" => 3 /* Predef.scala before Any.scala, etc. */ - case _ => goLast - } - } - files sortBy rank - } } // class Run def printAllUnits() { |