summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2009-07-24 07:26:27 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2009-07-24 07:26:27 +0000
commitf4301266d3eb395f0aaab3211eaaeaff898f9961 (patch)
tree34a02895c8ca98451e9272d13090b56b4e7ae870 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent50b5242ee355b32266b7c061b696ecad8f84332f (diff)
downloadscala-f4301266d3eb395f0aaab3211eaaeaff898f9961.tar.gz
scala-f4301266d3eb395f0aaab3211eaaeaff898f9961.tar.bz2
scala-f4301266d3eb395f0aaab3211eaaeaff898f9961.zip
fixed a bug with defaults reported on mailing list
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index c2d69637b1..7c1e072849 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1219,6 +1219,12 @@ trait Typers { self: Analyzer =>
def typedModuleDef(mdef: ModuleDef): Tree = {
//Console.println("sourcefile of " + mdef.symbol + "=" + mdef.symbol.sourceFile)
// attributes(mdef)
+ // initialize all constructors of the linked class: the type completer (Namer.methodSig)
+ // might add default getters to this object. example: "object T; class T(x: Int = 1)"
+ val linkedClass = mdef.symbol.linkedClassOfModule
+ if (linkedClass != NoSymbol)
+ for (c <- linkedClass.info.decl(nme.CONSTRUCTOR).alternatives)
+ c.initialize
val clazz = mdef.symbol.moduleClass
val typedMods = removeAnnotations(mdef.mods)
assert(clazz != NoSymbol)