-
-
Notifications
You must be signed in to change notification settings - Fork 384
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
MacOS
What is the issue affecting?
Annotations, Type Checking
Expected Behaviour
Follow the wiki tutorial:
local A = "Hello"
local B = "World"
---@alias myLiteralAliases `A` | `B`
---@param x myLiteralAliases
function foo(x) end
it should not show any warning when using it:
foo(A)
Actual Behaviour
It show warning:
Cannot assign `string` to parameter ``A`|`B``.
- `string` cannot match ``A`|`B``Lua Diagnostics.(param-type-mismatch)
Reproduction steps
Enter the code in VSCode
local A = "Hello"
local B = "World"
---@alias myLiteralAliases `A` | `B`
---@param x myLiteralAliases
function foo(x) end
foo(A)
then you will see it
Additional Notes
Some info:
$ code --version
1.73.0
8fa188b2b301d36553cbc9ce1b0a146ccb93351f
x64
$ ls ~/.vscode/extensions/ | grep sumneko
sumneko.lua-3.6.2-darwin-x64
Log File
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working