Last active
October 1, 2025 21:34
-
-
Save to11mtm/b131c72c1d5c534fbd71b45468787173 to your computer and use it in GitHub Desktop.
Abstract Class Funpost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Runtime.CompilerServices; | |
| using System.Runtime.Serialization; | |
| namespace derp; | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var obj = new object(); | |
| var fake = Unsafe.As<Foo>(obj); | |
| Console.WriteLine("Hello, World!"); | |
| fake.Baz(); | |
| var wat = new Wow(){The = "Wat"}; | |
| var fake2 = Unsafe.As<Wat>(wat); | |
| fake2.Baz(); | |
| } | |
| } | |
| abstract class Foo | |
| { | |
| public abstract void Bar(); | |
| public void Baz() | |
| { | |
| Console.WriteLine("Baz"); | |
| } | |
| } | |
| abstract class Wat | |
| { | |
| public string The { get; set; } | |
| public abstract void Bar(); | |
| public void Baz() | |
| { | |
| Console.WriteLine(The); | |
| } | |
| } | |
| public class Wow | |
| { | |
| public string The { get; set; } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment