Skip to content

Prevent unsupported return types from aborting LuaObject generation - #352

Merged
akeit0 merged 1 commit into
mainfrom
codex/issue212-generator-failures
Oct 10, 2026
Merged

akeit0 merged 1 commit into
mainfrom
codex/issue212-generator-failures

Conversation

@akeit0

@akeit0 akeit0 commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

A [LuaMember] returning LuaValue[] currently throws while method metadata is collected. That aborts the shared generator callback and removes bindings for unrelated, valid [LuaObject] classes, producing misleading CS0029 conversion errors.

Only named return types are now considered for awaitable detection. Unsupported arrays, pointers and function pointers reach normal validation instead. LUACS005 and LUACS006 now report the full type name at the offending method or parameter, while other LuaObjects keep generating.

Related to #212, particularly #212 (comment). Array return values remain unsupported; this change does not define multiple-return semantics for them. The incremental generator remains in use. Ordinary supported ref/out parameters already work and are covered by regression tests.

Validation:

  • Source generator: 41 tests passed, including 17 new cases for unsupported signatures, unaffected classes, ref/out and Task/ValueTask returns.
  • Runtime: 397 tests passed with TestCategory!=ExpectedFailure; Release builds for netstandard2.1, net6.0, net8.0 and net10.0 passed with warnings treated as errors.
  • CSharpier checked all 247 files; git diff --check passed.
  • Unity 6000.5.5f1, using the live internal project via the modern unity CLI and Pipeline: an array-returning class caused CS0029 on two other classes before the fix; the fixed generator produced only a located LUACS005. Supported instance ref/out, a property and Task compiled and executed from Lua, returning 3, 6, 2, 42, 4 as expected. Temporary assets were removed, original binaries restored and all six DLL/PDB hashes matched.

This verifies a concrete generator failure from #212. The original Unity 6000.1.5/6000.0.34, Unity 2022.3 and Unity 6.3 environment reports have not been reproduced on those versions, so the issue is kept open. No runtime/VM code or emitted code for supported signatures changes.

@akeit0
akeit0 merged commit 4496c7c 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.

1 participant