luau
luau copied to clipboard
Type functions cause crashes and other issues if used on a type that contains the function
Type functions seem to have issues when you use a type that a function is inside of. Here's a case that causes a crash 100% of the time:
--!strict
type function Type(t)
return t
end
local Table = {}
function Table.Foo<T>(arg: T)
return arg :: Type<T>
end
local test = Table.Foo(Table) --crashes upon typing
Here's a case that doesn't crash but causes a type error:
Type functions with containing types can be used for OOP. Here's what I was trying to do when I encountered this issue:
Hi there! The crash has been confirmed to be fixed by a flag which was flipped last week, although the erroneous type errors are still present.