-
Notifications
You must be signed in to change notification settings - Fork 96
Closed
Labels
bugSomething isn't workingSomething isn't workingluauFormatting related to LuauFormatting related to Luau
Description
Stylua causes a type error here:
type Object<T... = (nil)> = {
method: (T...) -> (),
}Here, (nil) represents a type pack of one element, which is the default for the generic type pack T.... Stylua removes the brackets around nil, meaning it is no longer a type pack and becomes a single type: assigning a type as the default value of a type pack is a type error.
Setting the default value of a type pack to (nil) is often useful for types which should support variadic behaviours, but mostly don't need them, and you don't want to clutter up your code with Object<T...> everywhere.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingluauFormatting related to LuauFormatting related to Luau