File tree 2 files changed +6
-1
lines changed
compiler/src/dotty/tools/dotc/transform
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,9 @@ class ParamForwarding(thisTransformer: DenotTransformer) {
55
55
stat match {
56
56
case stat : ValDef =>
57
57
val sym = stat.symbol.asTerm
58
- if (sym is (ParamAccessor , butNot = Mutable )) {
58
+ if (sym.is(ParamAccessor , butNot = Mutable ) && ! sym.info.isInstanceOf [ExprType ]) {
59
+ // ElimByName gets confused with methods returning an ExprType,
60
+ // so avoid param forwarding if parameter is by name. See i1766.scala
59
61
val idx = superArgs.indexWhere(_.symbol == sym)
60
62
if (idx >= 0 && superParamNames(idx) == stat.name) { // supercall to like-named parameter
61
63
val alias = inheritedAccessor(sym)
Original file line number Diff line number Diff line change
1
+ class X (val y : String )
2
+ class Y (y : => String ) extends X (y)
3
+ class Z (z : => String ) extends X (z)
You can’t perform that action at this time.
0 commit comments