File tree 1 file changed +2
-2
lines changed
src/dotty/tools/dotc/transform 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -85,13 +85,13 @@ import Decorators._
85
85
case _ =>
86
86
var rhs = tree.rhs.changeOwnerAfter(sym, field, thisTransform)
87
87
if (isWildcardArg(rhs)) rhs = EmptyTree
88
- val fieldDef = transformFollowing(ValDef (field, rhs))
88
+ val fieldDef = transformFollowing(ValDef (field, if ( ! rhs.isEmpty) Erasure . Boxing .adaptToType(rhs, field.info.widen) else rhs))
89
89
val getterDef = cpy.DefDef (tree)(rhs = transformFollowingDeep(ref(field))(ctx.withOwner(sym), info))
90
90
Thicket (fieldDef, getterDef)
91
91
}
92
92
} else if (sym.isSetter) {
93
93
if (! sym.is(ParamAccessor )) { val Literal (Constant (())) = tree.rhs } // this is intended as an assertion
94
- val initializer = Assign (ref(field), ref(tree.vparamss.head.head.symbol))
94
+ val initializer = Assign (ref(field), Erasure . Boxing .adaptToType( ref(tree.vparamss.head.head.symbol), field.info.widen ))
95
95
cpy.DefDef (tree)(rhs = transformFollowingDeep(initializer)(ctx.withOwner(sym), info))
96
96
}
97
97
else tree // curiously, some accessors from Scala2 have ' ' suffixes. They count as
You can’t perform that action at this time.
0 commit comments