if i use types
type TypeA<A... = ()> = {
value: TypeB<A...>,
}
type TypeB<A... = ()> = {
valueA: TypeB<A...>,
valueB: TypeB<A...>,
}
then it does not let me type cast
local a = {} :: TypeA<...number>
local b = a :: TypeA<...string>
here are some more examples
type TypeA<A... = ()> = {
value: TypeB<A...>,
}
type TypeB<A... = ()> = {
valueA: TypeB<A...>,
valueB: TypeB<A...>,
}
local function New<A...>()
local newA = {} :: TypeA
local newB = newA :: TypeA<A...>
end
type TypeA<A... = ()> = {
value: TypeB<A...>,
}
type TypeB<A... = ()> = {
valueA: TypeB<A...>,
valueB: TypeB<A...>,
}
local newA = {} :: TypeA<...any>
local newB = newA :: TypeA
type TypeA<A... = ()> = {
value: TypeB<A...>,
}
type TypeB<A... = ()> = {
valueA: TypeB<A...>,
valueB: TypeB<A...>,
}
local function New<T>(value: T) : T
return {}
end
local a = {} :: TypeA<...any>
local b = New(a) :: TypeA<...string>




