luau icon indicating copy to clipboard operation
luau copied to clipboard

[new solver] functions returning `never` aren't treated the same as `error` in codepath analysis

Open deviaze opened this issue 4 months ago • 0 comments

In my runtime, I have a function process.exit that immediately exits the current process and therefore should return never.

I find that error seems to be special cased or something, because my process.exit unfortunately doesn't have the same behavior in codepath analysis that error does (in fixing "not all codepaths in this function return..." TypeErrors)

Minimal-ish repro with some examples of what works and what doesn't:

https://github.com/deviaze/solverbugs/blob/main/src/never_says_never.luau

deviaze avatar Aug 13 '25 23:08 deviaze