Skip to content

Fix inherited LuaObject member and metamethod replacements - #350

Merged
akeit0 merged 1 commit into
mainfrom
codex/issue118-inherited-members
Oct 10, 2026
Merged

akeit0 merged 1 commit into
mainfrom
codex/issue118-inherited-members

Conversation

@akeit0

@akeit0 akeit0 commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Inherited [LuaMember] and [LuaMetamethod] declarations were emitted alongside explicitly annotated derived replacements. This made a derived constructor metamethod produce LUACS007, duplicated method wrapper fields, and sometimes silently selected a base property or method instead of a derived Lua alias.

Select the most derived annotated declaration for each Lua member name and metamethod. Enumerate overrides at every inheritance level so leaf types retain intermediate replacements. Member and metamethod bindings are selected independently when a method has both attributes. Definitions within the same declaring type remain available to existing duplicate diagnostics; this does not add overload support. Unannotated virtual overrides and the existing unannotated new constructor pattern retain their inherited exposure.

Fixes #118.

Validation:

  • 24 source generator tests pass, including 12 new compilation and duplicate-diagnostic cases. Five of those new cases fail on main.
  • 326 runtime tests pass; four new Lua execution tests cover constructors, virtual/new members, aliases across member kinds, three-level inheritance, index/newindex/tostring, and independently replaced dual bindings.
  • Generated inheritance consumer builds with warnings treated as errors on netstandard2.1, net6.0, net8.0, and net10.0: zero warnings/errors.
  • CSharpier and git diff checks pass. Verification files remain outside git.

@akeit0
akeit0 merged commit f91faee into main Oct 10, 2026
2 checks passed
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.

Override inherited LuaObject metamethods/members

1 participant