summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2009-11-26 12:25:49 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2009-11-26 12:25:49 +0000
commit333f70873b2fe09a518382a3d31b78659d8057a8 (patch)
tree55584187f77ee8d2a5df551588b66893d18323de /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent797b2aeda3786b4d38ad389380ee5f24fff1c9d6 (diff)
downloadscala-333f70873b2fe09a518382a3d31b78659d8057a8.tar.gz
scala-333f70873b2fe09a518382a3d31b78659d8057a8.tar.bz2
scala-333f70873b2fe09a518382a3d31b78659d8057a8.zip
improved fix for see #2489
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 20571f6c6d..943098fe62 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2079,7 +2079,14 @@ trait Typers { self: Analyzer =>
moreToAdd = initSize != scope.size
}
if (newStats.isEmpty) stats
- else newStats.toList ::: stats
+ else {
+ val (defaultGetters, others) = newStats.toList.partition {
+ case DefDef(mods, _, _, _, _, _) => mods.hasFlag(DEFAULTPARAM)
+ case _ => false
+ }
+ // default getters first: see #2489
+ defaultGetters ::: stats ::: others
+ }
}
val result = stats mapConserve (typedStat)
if (phase.erasedTypes) result