Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class UnrelatedClass
- {
- static void TestFunc()
- {
- }
- }
- class TestInventory : Inventory
- {
- unsafe int a;
- int b;
- virtual unsafe void TestFunc2()
- {
- // dummy function to test virtual unsafety below
- }
- override bool DrawPowerup(int x, int y)
- {
- a = 1; // should work
- b = 2; // should fail
- UnrelatedClass.TestFunc(); // should fail
- textureID tx = TexMan.CheckForTexture("M_DOOM", TexMan.TYPE_Any); // should work
- Screen.DrawHUDTexture(tx, 0, 0); // should work
- return true;
- }
- }
- class TestInventory2 : TestInventory
- {
- void TestFunc1()
- {
- a = 1; // should work
- b = 2; // should work
- }
- // test unsafe inheritance
- override void TestFunc2()
- {
- a = 1; // should work
- b = 2; // should fail
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement