Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace TestThisNull
- {
- using System;
- public static class Program
- {
- private static void Main()
- {
- var method = typeof(Foo).GetMethod(nameof(Foo.Bar));
- var action = (Action) Delegate.CreateDelegate(typeof(Action), null, method);
- action();
- }
- private class Foo
- {
- public void Bar()
- {
- // "Expression is always false" :-DD
- Console.WriteLine($"this == null = {this == null}");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment