Skip to content

feat(phase-12): Complete metamethods support#138

Merged
davydog187 merged 1 commit intomainfrom
phase-12-metamethods
Feb 12, 2026
Merged

feat(phase-12): Complete metamethods support#138
davydog187 merged 1 commit intomainfrom
phase-12-metamethods

Conversation

@davydog187
Copy link
Contributor

Summary

  • Function-valued __index and __newindex with chain depth limit (200)
  • __call metamethod for calling non-function values
  • __tostring metamethod in tostring() and print()
  • __metatable protection in getmetatable/setmetatable
  • String metatable with __index = string table (enables ("hello"):upper() syntax)
  • _G dynamic proxy with __index/__newindex delegating to state.globals
  • Refactored table access into table_index/table_newindex/index_value helpers

Test plan

  • Function-valued __index and __newindex (5 tests)
  • __call on tables (2 tests)
  • __tostring with custom objects (2 tests)
  • __metatable protection (2 tests)
  • String method syntax ("hello"):upper() (3 tests)
  • _G bidirectional read/write (2 unskipped tests)
  • 1229 tests, 0 failures, 33 skipped

🤖 Generated with Claude Code

- Function-valued __index and __newindex with chain depth limit
- __call metamethod for calling non-function values
- __tostring metamethod in tostring() and print()
- __metatable protection in getmetatable/setmetatable
- String metatable with __index = string table (enables ("hello"):upper())
- _G dynamic proxy with __index/__newindex to state.globals
- Refactored table access into table_index/table_newindex/index_value helpers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@davydog187 davydog187 merged commit 247d355 into main Feb 12, 2026
2 checks passed
@davydog187 davydog187 deleted the phase-12-metamethods branch February 12, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant