-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
/** For all parameter accessors
*
* val x: T = ...
*
* if
* (1) x is forwarded in the supercall to a parameter that's also named `x`
* (2) the superclass parameter accessor for `x` is accessible from the current class
* change the accessor to
*
* def x: T = super.x.asInstanceOf[T]
*
* Do the same also if there are intermediate inaccessible parameter accessor forwarders.
* The aim of this transformation is to avoid redundant parameter accessor fields.
*/
I have several questions to what this phase does:
- Why do names matter?
- if indeed name has not changed, is not it better to remove def entirely? Than virtual dispatch will do the same that
def x: T = super.x.asInstanceOf[T]
does. (I guess the answer is that types could be different, but I want to make sure that there are no other reasons)
Metadata
Metadata
Assignees
Labels
No labels