From 333f70873b2fe09a518382a3d31b78659d8057a8 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 26 Nov 2009 12:25:49 +0000 Subject: improved fix for see #2489 --- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3