diff options
author | Nicolas Stucki <nicolas.stucki@gmail.com> | 2016-12-17 18:42:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-17 18:42:06 +0100 |
commit | 5920b747e8263d8a7b0f8d913fd4fb24fc1f51ff (patch) | |
tree | 8f986e911ac2be9b472d3cea69e6a2792dee8f95 /compiler/src/dotty/tools/dotc/ast/Desugar.scala | |
parent | 9bbd04395f30748e57c0c93e768725adfac79769 (diff) | |
parent | 403a16f70edfc95da4b575bbee05d3d7cbc90704 (diff) | |
download | dotty-5920b747e8263d8a7b0f8d913fd4fb24fc1f51ff.tar.gz dotty-5920b747e8263d8a7b0f8d913fd4fb24fc1f51ff.tar.bz2 dotty-5920b747e8263d8a7b0f8d913fd4fb24fc1f51ff.zip |
Merge pull request #1815 from dotty-staging/fix-#1797
Fix #1797: Allow case class params with names _1, _2, ...
Diffstat (limited to 'compiler/src/dotty/tools/dotc/ast/Desugar.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/ast/Desugar.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index 11f8b81eb..bb15edf5a 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -343,8 +343,9 @@ object desugar { def syntheticProperty(name: TermName, rhs: Tree) = DefDef(name, Nil, Nil, TypeTree(), rhs).withMods(synthetic) val caseParams = constrVparamss.head.toArray - val productElemMeths = for (i <- 0 until arity) yield - syntheticProperty(nme.selectorName(i), Select(This(EmptyTypeIdent), caseParams(i).name)) + val productElemMeths = + for (i <- 0 until arity if nme.selectorName(i) `ne` caseParams(i).name) + yield syntheticProperty(nme.selectorName(i), Select(This(EmptyTypeIdent), caseParams(i).name)) def isRepeated(tree: Tree): Boolean = tree match { case PostfixOp(_, nme.raw.STAR) => true case ByNameTypeTree(tree1) => isRepeated(tree1) |