Need some way to get newMethod tpt (MethodType, PolyType, ByNameType) of existing DefDef #16266
Labels
area:metaprogramming:reflection
Issues related to the quotes reflection API
Milestone
I am trying to make a copy of a method but I need to change its return-type, all of the arguments stay the same. I can't use
DefDef.copy
because return-type is part of the symbol (as I saw in #7626) so instead I'm usingDefDef.apply
(based on #8090) but I need to figure out what thetpt:MethodType | PolyType | ByNameType
is myself based on theparamss
etc... factoring in potential polymorphic type parameters. That's an awful lot of work just to copy a method! Is there some way to get thetpt
of an existing DefDef?(Also, is there even a way to copy methods with given parameter clauses and parameters with default values? I don't see how to do that using the
Symbol.newMethod
/DefDef.apply
API)The text was updated successfully, but these errors were encountered: