diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-05 16:51:31 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-05 16:51:31 +0100 |
commit | cd28a05fa16b5b2cf3569f0ab0a8c9c685e41bf1 (patch) | |
tree | e129ea30724491d72d9b27cc6a3d546fa83afd6d /src/dotty/tools/dotc/core/NameOps.scala | |
parent | c2f101a33ea7f89681d6b74731bbcff948e7e6da (diff) | |
download | dotty-cd28a05fa16b5b2cf3569f0ab0a8c9c685e41bf1.tar.gz dotty-cd28a05fa16b5b2cf3569f0ab0a8c9c685e41bf1.tar.bz2 dotty-cd28a05fa16b5b2cf3569f0ab0a8c9c685e41bf1.zip |
Fixes to named and default arguments.
Now come with test cases.
Diffstat (limited to 'src/dotty/tools/dotc/core/NameOps.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/NameOps.scala | 7 |
1 files changed, 5 insertions, 2 deletions
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 <init> */ + /** Nominally, name$default$N, encoded for <init> + * @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 <init> */ |