summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-04 11:56:16 -0800
committerPaul Phillips <paulp@improving.org>2012-02-04 12:59:08 -0800
commit3a6b1124f18acf95923e228f6f41bdf3c23e0173 (patch)
tree4f934f594942d6366e3ca75663721e15ccb53c1a /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent6b8aed72e4f7a7135a434533399a772bf7078101 (diff)
downloadscala-3a6b1124f18acf95923e228f6f41bdf3c23e0173.tar.gz
scala-3a6b1124f18acf95923e228f6f41bdf3c23e0173.tar.bz2
scala-3a6b1124f18acf95923e228f6f41bdf3c23e0173.zip
Guard List_apply from premature forcitude.
Solved the annotation cycle puzzle. Was being burned again by the hack which preferentially treats List() as Nil to avoid List's extractor. This commit includes a new starr which fully bootstraps. Also at this point traits can extend Any and will not be given an AnyRef parent (until erasure.) This is the case for AnyVal and NotNull.
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, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index fdeab7b565..1d84f7fdaf 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2525,8 +2525,11 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser {
/** This is translating uses of List() into Nil. This is less
* than ideal from a consistency standpoint, but it shouldn't be
* altered without due caution.
+ * ... this also causes bootstrapping cycles if List_apply is
+ * forced during kind-arity checking, so it is guarded by additional
+ * tests to ensure we're sufficiently far along.
*/
- if (fun.symbol == List_apply && args.isEmpty && !forInteractive)
+ if (args.isEmpty && !forInteractive && fun.symbol.isInitialized && ListModule.hasCompleteInfo && (fun.symbol == List_apply))
atPos(tree.pos)(gen.mkNil setType restpe)
else
constfold(treeCopy.Apply(tree, fun, args1) setType ifPatternSkipFormals(restpe))