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
Hi, let's try to make a rewriter for extension methods. It would allow to avoid ambiguous call compilation errors :
publicstaticclassSomeClass{publicstaticvoidMyExtension(thisstringmyString){ ...}publicstaticvoidMyMethod(){"someValue".MyExtension()}//Will cause an ambiguous call in the compilerpublicstaticvoidMyMethod(){ MyExtension("someValue")}//This works and is the current workaround.}
The text was updated successfully, but these errors were encountered:
Thanks - I think extensions are also part of other feature. Off top of my head there were some more issues with that unfortunately.
I think especially for rewritten code where YourType would end up YourType__Patched_ and extension method will complain.
We could probably cast it to (ProperType)(dynamic)variable. That's a hack for compiler as your variable is still of old type, same approach is used for something else already (I think for 'this' rewritting)
Is it not possible for rewriting extension methods yet now? Currently I’m working with one ECS framework of Unity, and it uses extension method almost everywhere :(
Hi, let's try to make a rewriter for extension methods. It would allow to avoid ambiguous call compilation errors :
The text was updated successfully, but these errors were encountered: