- Extend CoreMethodId with is_pure(), allowed_in_condition(), allowed_in_init() - New MethodCallLowerer box for metadata-driven MethodCall lowering - Integrate MethodCall handling in condition_lowerer - P0: Zero-argument methods (length) supported - Design principle: NO method name hardcoding, CoreMethodId metadata only 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
23 lines
529 B
Plaintext
23 lines
529 B
Plaintext
// Phase 224-B: MethodCall lowering test - s.length() in loop condition
|
|
//
|
|
// Test case: Simple loop using s.length() in condition
|
|
// Expected: MethodCall should be lowered to BoxCall instruction
|
|
//
|
|
// Pattern 1: Simple while loop (no break, no continue)
|
|
|
|
static box Main {
|
|
main() {
|
|
local s = "Hello"
|
|
local i = 0
|
|
|
|
// Pattern 1 loop with MethodCall in condition
|
|
loop(i < s.length()) {
|
|
i = i + 1
|
|
}
|
|
|
|
// Output result
|
|
print("i = " + i)
|
|
return i
|
|
}
|
|
}
|