From cd28a05fa16b5b2cf3569f0ab0a8c9c685e41bf1 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 5 Dec 2013 16:51:31 +0100 Subject: Fixes to named and default arguments. Now come with test cases. --- src/dotty/tools/dotc/core/NameOps.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/core/NameOps.scala') diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala index c9665577d..41384e346 100644 --- a/src/dotty/tools/dotc/core/NameOps.scala +++ b/src/dotty/tools/dotc/core/NameOps.scala @@ -203,10 +203,13 @@ object NameOps { } } - /** Nominally, name$default$N, encoded for */ + /** Nominally, name$default$N, encoded for + * @param Post the parameters position. + * @note Default getter name suffixes start at 1, so `pos` has to be adjusted by +1 + */ def defaultGetterName(pos: Int): TermName = { val prefix = if (name.isConstructorName) DEFAULT_GETTER_INIT else name - prefix ++ DEFAULT_GETTER ++ pos.toString + prefix ++ DEFAULT_GETTER ++ (pos + 1).toString } /** Nominally, name from name$default$N, CONSTRUCTOR for */ -- cgit v1.2.3