# Phase 8.9: Test explicit birth() syntax
# This file tests that explicit birth() calls work correctly

print("=== Testing explicit birth() syntax ===")

# Test 1: Basic explicit birth() call
box SimpleBox {
    init { content }
    
    birth(data) {
        me.content = data
        print("SimpleBox birth: " + data)
    }
    
    getContent() {
        return me.content
    }
}

local simple = new SimpleBox("test_data")
print("Content: " + simple.getContent())

# Test 2: Explicit birth() with inheritance
box EnhancedString from StringBox {
    init { prefix }
    
    birth(content, prefixStr) {
        from StringBox.birth(content)  # ✅ Explicit syntax
        me.prefix = prefixStr
        print("EnhancedString birth: " + prefixStr + " -> " + content)
    }
    
    override toString() {
        return me.prefix + ": " + from StringBox.toString()
    }
}

local enhanced = new EnhancedString("Hello World", "MESSAGE")
print("Enhanced string: " + enhanced.toString())

# Test 3: Multiple inheritance levels
box SuperEnhancedString from EnhancedString {
    init { suffix }
    
    birth(content, prefixStr, suffixStr) {
        from EnhancedString.birth(content, prefixStr)  # ✅ Explicit parent birth
        me.suffix = suffixStr
        print("SuperEnhancedString birth: " + suffixStr)
    }
    
    override toString() {
        return from EnhancedString.toString() + " [" + me.suffix + "]"
    }
}

local superEnh = new SuperEnhancedString("Amazing", "SUPER", "END")
print("Super enhanced: " + superEnh.toString())

print("=== All explicit birth() tests passed ===")