- Parser guard: Reject weak(...) with LPAREN check in parse_unary()
- Error: "Use 'weak expr', not 'weak(expr)'" (helpful message)
- Location: src/parser/expressions.rs:248-256
- MIR builder guard: Defense-in-depth for any bypassed cases
- Location: src/mir/builder/calls/build.rs:37-46
- Rejection test: apps/tests/phase285w_weak_call_rejected.hako
- Smoke test: phase285w_weak_call_rejected_vm.sh (PASS ✅)
- Documentation:
- EBNF.md: Add ~ (BitNot) to unary operators
- lifecycle.md: Document weak(expr) as invalid syntax
- phase-285/README.md: Add Phase 285W-Syntax-0.1 entry
Test results: 5/6 phase285 tests PASS (1 unrelated failure)
SSOT: docs/reference/language/lifecycle.md
Closes: Phase 285W-Syntax-0.1
17 lines
382 B
Plaintext
17 lines
382 B
Plaintext
// Phase 285W-Syntax-0.1: Verify weak(x) function call syntax is rejected
|
|
// Expected: Parse error with helpful message
|
|
// SSOT: docs/reference/language/lifecycle.md (weak <expr> only)
|
|
|
|
box SomeBox {
|
|
x
|
|
}
|
|
|
|
static box Main {
|
|
main() {
|
|
local obj = new SomeBox()
|
|
obj.x = 42
|
|
local w = weak(obj) // ❌ ERROR: Should be "weak obj"
|
|
return 0
|
|
}
|
|
}
|