luau
luau copied to clipboard
Self-bound types produced with the `index<>` type function and `typeof` being used recursively, crashing the new solver
As of version 0.658, the following two cases crash the new solver, regardless of strict mode being used. Due to typeof being used recursively this should produce a type error instead, however it crashes instead:
--!strict
local propertyKeys:{propertyKey} = nil::never
--InternalCompilerError - ConstraintSolver::unblock encountered a self-bound type!
type propertyKey = index<typeof(propertyKeys), number>
Changing the case slightly results in a different error (possibly the same underlying cause?):
--!strict
--InternalCompilerError - Luau::follow detected a Type cycle!!
local propertyKeys:{propertyKey} = nil::never
type propertyKey = index<typeof(propertyKeys), number>
local propertyKey:propertyKey = propertyKeys
if propertyKey then end