JohnnyMorganz/StyLua

Don't remove parenthesis in `Rest...` generics.

howmanysmall opened this issue · 2 comments

I don't really know how to explain this but I do have a reproduction.

-- Given this type:
type Function<T..., R...> = any

do
    type ThisIsOkay = Function<(), ({[string]: number})>
    type ThisIsInvalidAndWhatResultsFromFormatting = Function<(), {[string]: number}>
end

do
    type ThisIsOkay2 = Function<(string), ({[string]: number})>
    type ThisIsInvalidAndWhatResultsFromFormatting2 = Function<string, {[string]: number}>
end

Basically, if there's two Rest... generics in a type, you should not format away the parenthesis for any of them.

I cannot reproduce this. This should've been fixed in #730

Are you on the latest version?

oh good lord i was WAY out of date