Files
hakorune/examples/text_adventure/test_room_init.hako

20 lines
394 B
Plaintext

// Test Room initialization issue
box TestBox {
init { a, b, c }
TestBox(a, b) { // Only 2 params in constructor
me.a = a
me.b = b
me.c = "default"
}
}
print("Testing mismatched init/constructor...")
obj = new TestBox("first", "second")
print("Field a: " + obj.a)
print("Field b: " + obj.b)
print("Field c: " + obj.c)
print("\n✅ Test completed!")