impromptu-interface icon indicating copy to clipboard operation
impromptu-interface copied to clipboard

Source generators

Open nicomoya123 opened this issue 4 years ago • 2 comments

I want to implement something similar to this package using the new source generators package, Do you think it will be possible ?

nicomoya123 avatar May 06 '21 13:05 nicomoya123

Yeah I think it's possible, for the explicit generic argument ActLike.

As making the proxies is trivial source wise. just an object implementing an interface where each method is just forwarding the call to a dynamic typed _target. Just have to identify each place you use it.

jbtule avatar May 06 '21 16:05 jbtule

What if a method is not implemented in the target class. In that case, ActLike can compile and run as long as you don't call it. But the source generator won't compile and you need to have an exact match?

goyzhang avatar May 27 '21 09:05 goyzhang