I noticed a strange warning relating to function parameters and variadic generics. I recreated the scenario using an example type and function to see if I was doing something wrong, and the warning still appeared. I’ve tried casting the Object variable and that didn’t work either.
I’m using the typechecker beta.
Here’s the error on line 15:
Type Error: Type ‘Example<T…>’ could not be converted into ‘Example’; this is because accessing
Method, takes a tail ofT...and accessingMethod, takes the portion of the type pack starting at index 0 to the endstring, andT...is not exactlystring
Here’s the source code:
--!strict
type Example<T...> = {
Method: (T...) -> ();
}
local function CreateExample<T...>(Method: (T...) -> ()): Example<T...>
local self = {}
self.Method = Method
return self
end
local Object: Example<string> = CreateExample(function(a: string)
print(a)
end)
Object.Method("Hello World!")
A screenshot just in case
