Skip to content

fix: support union type in as_doc_function_type#1013

Open
EfveZombie wants to merge 1 commit intoEmmyLuaLs:mainfrom
EfveZombie:fix.union-type-doc-function
Open

fix: support union type in as_doc_function_type#1013
EfveZombie wants to merge 1 commit intoEmmyLuaLs:mainfrom
EfveZombie:fix.union-type-doc-function

Conversation

@EfveZombie
Copy link
Copy Markdown

Support union types in as_doc_function_type, enabling correct pcall return type inference when the callee has overloaded members.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves type inference for overloaded functions by updating as_doc_function_type to handle LuaType::Union variants and adds regression tests for pcall scenarios. The reviewer provided a performance optimization suggestion to avoid unnecessary cloning when iterating over union members by matching on the LuaUnionType variants directly, which I have included in the feedback.

@EfveZombie EfveZombie force-pushed the fix.union-type-doc-function branch from b13608c to 713aa46 Compare April 7, 2026 12:15
@EfveZombie EfveZombie force-pushed the fix.union-type-doc-function branch from 713aa46 to 98231c4 Compare April 10, 2026 14:25
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