Skip to content
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

Methods of explicitly declared class types receive the function semantic token #531

Closed
lolmanurfunny opened this issue Jan 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@lolmanurfunny
Copy link

lolmanurfunny commented Jan 13, 2024

Methods of explicitly declared class types currently receive the function token instead of method. In contrast, inferred types are handled as expected.

type myClass = {
    foo: (self: myClass) -> ()
}

local a: myClass = nil

a:foo()

image

Inferred type
local myClass = {}
myClass.__index = myClass

function myClass.new()
    return setmetatable({}, myClass)
end

function myClass:foo()
    return
end

type myClass = typeof(myClass.new())

local a: myClass = myClass.new()

a:foo()

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants