✓
Passing This code compiles and runs correctly.
Code
// Test 643: Multiple Defaults Error (MUST_ERROR)
// Tests that having multiple [default] definitions for the same name is an error
//
// This is a STDLIB BUG - only one default per name is allowed
// Expected: Compilation error "Multiple default implementations for 'test'"
~import std/build
~import app/lib/extra_build
// This file defines ONE default
~[default]
std/build:step(name: "test") {
echo "Main test implementation"
}
Frontend must reject with:
CONTAINS MultipleDefaultsExpected compiler error
error[KORU002]: module not found: 'std/compiler'
--> tests/regression/500_INTEGRATION_TESTING/510_NEGATIVE_TESTS/510_012_multiple_defaults_error/input.kz:0:1
|
0 | ~import std/compiler
| ^
hint: check the import path, the aliases declared by std/compiler:paths, and KORU_STDLIB/KORU_PATH environment variables
Imported Files
// This module ALSO defines a default "test" - this is the error!
~import std/build
~[default]
std/build:step(name: "test") {
echo "Extra test implementation - THIS IS A BUG!"
}