Hi all!
In my visitor method visitSuperConstructorReference(SuperConstructorReference
x) (i.e. the one being called when 'super()' appears in target code), I
planned to call visitMethodReference() and do the processing in it (i.e.
treating the SuperConstructorReference like an ordinary method reference).
(This to have the code for all method references in one place.) What do I need
to do in visitSuperConstructorReference() before calling visitMethodReference?
The same question and reasoning applies also to
visitThisConstructorReference().
Thanks in advance for any help, it's greatly appreciated!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
well, you cannot cast a This/SuperConstructorReference to a MethodReference.
What you can do, is to extract all the desired information from both
MethodReference and This/SuperConstructorReference (e.g., the arguments) in
then visitXZY methods, and then call a common method that does the actual
processing.
/Tobias
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all!
In my visitor method visitSuperConstructorReference(SuperConstructorReference
x) (i.e. the one being called when 'super()' appears in target code), I
planned to call visitMethodReference() and do the processing in it (i.e.
treating the SuperConstructorReference like an ordinary method reference).
(This to have the code for all method references in one place.) What do I need
to do in visitSuperConstructorReference() before calling visitMethodReference?
The same question and reasoning applies also to
visitThisConstructorReference().
Thanks in advance for any help, it's greatly appreciated!
Hi,
well, you cannot cast a This/SuperConstructorReference to a MethodReference.
What you can do, is to extract all the desired information from both
MethodReference and This/SuperConstructorReference (e.g., the arguments) in
then visitXZY methods, and then call a common method that does the actual
processing.
/Tobias