Type solver OOM / crash on circular type definition combined with typeof(constructor)
I was using a spring module by “bhristt” ( bhristt/Spring-Module) for one of my viewmodels. At first, I was putting the springs in a table which for some reason does not crash. But then by accident I put it in a normal local variable:
local FovSpring = Spring.new(.3, 14, 25, 0, 0, 0)
After that, every time I typed the letter s within the scope of that variable, studio would instantly crash.
I traced it back to this line in his module
type SpringObject = typeof(Spring.new(1, 0, 1)) & Eq.Spring;
The crash is fixed when I type this instead
type SpringObject = any
Or if I type this when declaring the variable
local FovSpring:any = Spring.new(.3, 14, 25, 0, 0, 0)
The way he’s typing his spring probably isn’t correct. But even so, I can’t imagine this is intended behavior to just crash instantly with not safeguards.
video of crash