012 auto import parent

✓ Passing This code compiles and runs correctly.

Code

// Test: Auto-import parent module
//
// When importing "$testlib/mymod/sub", the parent "mymod.kz" should
// be automatically imported alongside it.
//
// Structure:
//   testlib/
//     mymod.kz        → parent_hello event
//     mymod/
//       sub.kz        → sub_hello event

~import "$std/compiler"

// Only import the submodule - parent should come automatically
~import "$testlib/mymod/sub"

// Use event from submodule (explicitly imported)
~testlib.mymod.sub:sub_hello()

// Use event from parent (auto-imported)
~testlib.mymod:parent_hello()
input.kz

Imported Files

// Submodule - this is what we explicitly import

~pub event sub_hello {}

~proc sub_hello {
}
testlib/mymod/sub.kz
// Parent module - should be auto-imported when importing mymod/sub

~pub event parent_hello {}

~proc parent_hello {
}
testlib/mymod.kz

Test Configuration

Expected Behavior:

SUCCESS