Open Daw588 opened 1 month ago
The problem here is that intersections of the function
type (or unions including it) with individual specific function types do not correctly simplify. So, (() -> number) | nil
intersected with ~(false | nil)
(which is what the refinement for a truthy test does) doesn't correctly simplify to () -> number
. We might be able to fix this sooner, but this will definitely be addressed by the upcoming work on integrated e-graphs (#1285, but there's follow-up integration work that is under way).
I have a
Main
function that will be called twice, and the second time it gets called it will print64
. However the type solver throws unclear type error.This does not happen when the if statement is not wrapped inside a function.