-
-
Notifications
You must be signed in to change notification settings - Fork 398
Open
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
Expected Behaviour
local ffi = require("ffi")
---@generic T
---@param ct `T`
---@return fun(x: T): `T`*
local function ref(ct)
return function (init)
return ffi.new(ct.."[1]", {init})
end
end
ffi.cdef [[
typedef struct MyStruct {
int a, b;
} MyStruct;
]]
---@class MyStruct
---@field a integer
---@field b integer
---@class MyStruct* : { [integer] : MyStruct }, ffi.cdata*
local x = ffi.ref "MyStruct" {
a = 4,
b = 2
}
--type of `x` expected to be `MyStruct*`Actual Behaviour
type of x is MyStruct
Reproduction steps
Run the code and check types
Additional Notes
No response
Log File
No response
Metadata
Metadata
Assignees
Labels
No labels