○
Planned This feature is planned but not yet implemented.
ECOLOGY: Circular imports should work without kludges
Failure Output
Showing last 10 of 42 lines
--> tests/regression/300_ADVANCED_FEATURES/320_STDLIB/320_080_ecology_circular_import/input.kz:14:0
❌ Compiler coordination error: Unknown event referenced
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/320_STDLIB/320_080_ecology_circular_import/backend.zig:10906:17: 0x1005be433 in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/320_STDLIB/320_080_ecology_circular_import/backend.zig:10990:28: 0x1005bf1bf in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^ Code
// ECOLOGY TEST: Circular import should work without compiler_requirements kludge
//
// ISSUE: compiler_requirements module is special-cased in compiler_requires.zig
// because of circular import issues. This test captures the intention that
// proper circular imports SHOULD work.
//
// When we fix the circular import architecture, this test should pass
// without the special-casing kludge.
~import std/io
// Module A imports Module B
~module moduleA {
import moduleB
~event greetA {}
~greetA = moduleB:greetB() |> done {}
}
// Module B imports Module A (circular!)
~module moduleB {
import moduleA
~event greetB {}
~greetB = std/io:print.ln("Hello from B") |> done {}
}
// Main flow uses moduleA
~moduleA:greetA() |> std/io:print.ln("Circular import worked!")