You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix#2099: Make param forwarders override the param they forward to
Previously, in the following code:
class A(val member: Int)
class SubA(member: Int) extends A(member)
We created a forwarder in SubA like this:
private[this] def member: Int = super.member
Since a private method cannot have the same name as an inherited
non-private one, we subsequently name-mangled the forwarder in
ExpandPrivate. However, this was only done in the TreeTransformer, not
in the DenotTransformer, this lead to separate compilation issues (see
added testcase).
Since we cannot detect that a ParamAccessor is a forwarder in a
DenotTransformer, we cannot fix the problem locally in ExpandPrivate.
Instead, we change ParamForwarding so that the forwarder now looks like:
override def member: Int = super.member
To make this work we restrict ParamForwarding to only create forwarders
for non-final fields.
0 commit comments