[Proposal] Simplified ldftn/ldvirtftn
See original GitHub issueHi Lucas!
I would like to propose simplified way to use ldftn
and ldvirtftn
instructions:
public static void Ldftn<TMethod>(TMethod method) where TMethod : Delegate;
public static void Ldvirtftn<TMethod>(TMethod method) where TMethod : Delegate;
With these methods I can specify method directly without construction of MethodRef
. In case of ldvirtftn
it easily to analyze whether the specified method is virtual/abstract or not.
Alternative approach is to use factory method declared in MethodRef
class:
public static MethodRef Create<TMethod>(TMethod method) where TMethod : Delegate;
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Making proposals simple
A simple technique for improving proposal storytelling, messages, themes, and positioning · How to formulate win strategies in just 3 steps · Do...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I got it mostly implemented in the methodref-delegate branch. I just need to make sure I didn’t forget anything, and maybe do some cleanup. I should release it soon.
I changed one thing though: referencing a compiler-generated method will generate an error instead of a warning. After seeing what the C# compiler generates for the various cases, I realized there’s really no good way to use such a method in a sane way.
I suppose I can add a warning for these cases, mostly to prevent unintentional misuse.
You can suppress InlineIL warnings through the weaver config.