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

Unwanted removal of parenthesis around pack parameters in Luau #729

Closed
littensy opened this issue Jul 4, 2023 · 0 comments · Fixed by #730
Closed

Unwanted removal of parenthesis around pack parameters in Luau #729

littensy opened this issue Jul 4, 2023 · 0 comments · Fixed by #730
Labels
bug Something isn't working

Comments

@littensy
Copy link

littensy commented Jul 4, 2023

The formatter removes parenthesis around pack parameters that contain only one type, which can cause an error with linters: Type parameters must come before type pack parameters

For example, if you set up the following code:

type SomeType<T..., U...> = (T...) -> U...
local fn: SomeType<(string, number), (boolean)>

StyLua will format it to this:

type SomeType<T..., U...> = (T...) -> U...
local fn: SomeType<(string, number), boolean>

Without the parenthesis around pack parameters, the type of fn will incorrectly resolve to (string, number) -> () in this case with Luau LSP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants