Repository navigation
Prevent unsupported return types from aborting LuaObject generation - #352
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
[LuaMember]returningLuaValue[]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/outparameters already work and are covered by regression tests.Validation:
TestCategory!=ExpectedFailure; Release builds for netstandard2.1, net6.0, net8.0 and net10.0 passed with warnings treated as errors.git diff --checkpassed.unityCLI 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, returning3, 6, 2, 42, 4as 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.