refactor(semantic): specialize operator function storage - #1063
Conversation
83b97ae to
13b2748
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors the representation of Lua operators by introducing a specialized OperatorFunction enum with variants for binary, unary, call, and overload operations. This change improves the precision of operator analysis but introduces a regression in get_operator_func, where the reconstructed function signatures for binary and unary operators omit the required self parameter. Additionally, the implementation for the Overload variant incorrectly strips the first parameter, which will result in inaccurate signature help for developers.
80af06c to
f8084e8
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the OperatorFunction enum into specific variants—BinOp, UnOp, Call, and Overload—to more accurately represent Lua operators and simplify their analysis. The review feedback identifies that the Call variant lacks an is_vararg field, which leads to the loss of variadic information and incorrect function reconstruction. Furthermore, a debug_assert! added to get_operand for non-binary operators is flagged as potentially too restrictive compared to the previous implementation.
4cdbff0 to
6da0795
Compare
|
/gemini review |
Store annotation operators as operator-specific shapes instead of using LuaFunctionType for every operator. Keep overloads, runtime signatures, and default constructors on the function-shaped paths where those fields still matter. Assisted-by: Codex
There was a problem hiding this comment.
Code Review
This pull request refactors the representation of Lua operators by replacing the generic OperatorFunction::Func variant with more specific variants: BinOp, UnOp, Call, and Overload. This change simplifies the analysis of metamethods and improves type inference for various operator types, including support for variadic call operators. A new test case was added to ensure that variadic call operators do not trigger incorrect redundant parameter diagnostics. I have no feedback to provide.
6da0795 to
cf4aa99
Compare
LuaFunctionType@overload, runtime metatable signatures, and default constructors on function-shaped paths