Skip to content

fix: type narrowing bugs with literal fields #3098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 10, 2025

Conversation

lewis6991
Copy link
Contributor

@lewis6991 lewis6991 commented Feb 27, 2025

Fixes #3089
Fixes #2952
Fixes #3056

@tomlau10
Copy link
Contributor

In order to properly link multiple issues, I believe the PR description needs to be:

Fixes #3089, Fixes #2952, Fixes #3056

i.e. each issue needs to be prefixed with Fixes 👀

Currently only #3089 is linked:
image

@@ -268,6 +268,11 @@ local function getNodeTypesWithLiteralField(uri, source, fieldName, literal)
return
end

-- Literal must has a value
if literal[1] == nil then
return
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is only reachable when literal.type = 'nil'.

@sumneko sumneko merged commit b4405b3 into LuaLS:master Mar 10, 2025
11 checks passed
@lewis6991 lewis6991 deleted the fix/narrow branch March 10, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants