Fix ModuloBox E0046 error and add null literal support

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-15 07:29:52 +00:00
parent 426571db5e
commit aae81ec4d5
9 changed files with 205 additions and 1 deletions

View File

@ -0,0 +1,71 @@
// Test for proper static box usage patterns
static box StaticBoxTest {
init { console, test_result }
main() {
me.console = new ConsoleBox()
me.console.log("🧪 Testing proper static box patterns")
// ✅ Correct: Call static method directly
local result = StaticBoxTest.test_static_method()
me.console.log("Static method result: " + result)
// ✅ Correct: Access static box fields through me
me.test_result = "Static box initialization successful"
me.console.log("Static field access: " + me.test_result)
me.console.log("✅ Static box pattern tests completed")
return "Static box usage verified"
}
test_static_method() {
return "Static method executed successfully"
}
}
// Test proxy server pattern (simplified)
static box SimpleProxyTest {
init { console, port, running }
main() {
me.console = new ConsoleBox()
me.console.log("🌐 Testing simplified proxy server pattern")
// ✅ Correct: Initialize static box fields
me.port = 8080
me.running = true
me.console.log("Proxy configured on port: " + me.port)
me.console.log("Proxy running status: " + me.running)
// ✅ Correct: Call other static methods
local startup_result = SimpleProxyTest.simulate_startup()
me.console.log("Startup result: " + startup_result)
return "Proxy simulation complete"
}
simulate_startup() {
return "Proxy server simulation started successfully"
}
}
// Entry point
static box Main {
init { console }
main() {
me.console = new ConsoleBox()
me.console.log("🚀 Testing Static Box Patterns")
// Test both static box patterns
local test1_result = StaticBoxTest.main()
me.console.log("Test 1: " + test1_result)
local test2_result = SimpleProxyTest.main()
me.console.log("Test 2: " + test2_result)
me.console.log("✅ All static box pattern tests passed")
return "Static box tests complete"
}
}