Implement Castclass

This commit is contained in:
Smaug123
2025-06-27 11:41:41 +01:00
parent 5cf0789439
commit 1ebcd0b4f5
42 changed files with 856 additions and 132 deletions

View File

@@ -0,0 +1,18 @@
public class Program
{
public class CustomClass
{
public int Id { get; set; }
}
public static int Main(string[] args)
{
CustomClass custom = new CustomClass { Id = 42 };
// Everything can be cast to System.Object
System.Object obj = (System.Object)custom;
// Verify it's the same object
return obj != null && obj == custom ? 42 : 0;
}
}