summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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