[New Type Solver] Crash when a Type Function returns a recursive parameter of a function-type

A crash occurs when a type function returns a recursive parameter (as itself, or as part of another type) of a function-type that has an annotated return type which returns a singleton-type that is resolved inside the function.

Minimum Reproduction Code:

--!strict

type Foo = typeof(function(a: Foo): () -- Only crashes when a return type is annotated
	return "" -- Only crashes with singleton types, and only when it needs to be resolved within the function
end)

type function TypeFunc(ty)
	return ty -- Only crashes when the recursive parameter is returned
end

type FooFromTypeFunc = TypeFunc<Foo>

System Information:

  • Windows 11 Pro 25H2
  • AMD Ryzen 7 5700X3D 8-Core Processor
  • 32 GB DDR4
  • AMD Radeon RX 5700 XT

Crash dump is included in the private message attached to this bug report.

A private message is associated with this bug report

Hello! Thank you for the report, and luckily a fix for this issue is on the way! This appears to have the same root cause as Studio Crashes due to the New Type Solver Unable to Infer Complex Type Aliases. We’ll try to keep you in the loop as said fix rolls out.

1 Like

Thanks for responding!
However, the bug report you’ve linked is this current bug report, is this issue already known?

My mistake! I’ve updated my answer to link to the actual bug report.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.