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

TypeError with function definitions #1465

Open
Uhsleep opened this issue Oct 6, 2024 · 0 comments
Open

TypeError with function definitions #1465

Uhsleep opened this issue Oct 6, 2024 · 0 comments
Labels
bug Something isn't working new solver This issue is specific to the new solver.

Comments

@Uhsleep
Copy link

Uhsleep commented Oct 6, 2024

I created a type with a function definition and a table that is of that type. However, when I create the function with the exact definition the type has, I get an error saying the table can't be converted to the type. It only happens when using the new solver.

--!strict
type FooType = {
    SetValue: (Value: number) -> ()
}

local Foo: FooType = {
    SetValue = function(Value: number)

    end
}
TypeError: Type '{ SetValue: (number) -> () }' could not be converted into 'FooType'; type { SetValue: (number) -> () }[read "SetValue"].arguments().tail() (...any) is not exactly FooType[read "SetValue"].arguments() (number)
@Uhsleep Uhsleep added the bug Something isn't working label Oct 6, 2024
@vegorov-rbx vegorov-rbx added the new solver This issue is specific to the new solver. label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new solver This issue is specific to the new solver.
Development

No branches or pull requests

2 participants