Fix eager instantiation for deeply structured types

This commit is contained in:
Sam Vervaeck 2023-05-23 21:29:27 +02:00
parent 7d694d9a31
commit be6537f9b9
Signed by: samvv
SSH key fingerprint: SHA256:dIg0ywU1OP+ZYifrYxy8c5esO72cIKB+4/9wkZj1VaY

View file

@ -7,7 +7,7 @@
// TODO Fix TVSub to use TVar.Id instead of the pointer address // TODO Fix TVSub to use TVar.Id instead of the pointer address
// Optimise constraint solving by solving some constraints during inference // TODO Deferred diagnostics
#include <algorithm> #include <algorithm>
#include <iterator> #include <iterator>
@ -519,12 +519,11 @@ namespace bolt {
addConstraint(NewConstraint); addConstraint(NewConstraint);
} }
// Note the call to solve? This is because constraints may have already // Note the call to simplify? This is because constraints may have already
// been solved, with some unification variables being erased. To make // been solved, with some unification variables being erased. To make
// sure we instantiate unification variables that are still in use // sure we instantiate unification variables that are still in use
// we solve before substituting. // we solve before substituting.
// TODO perform a full solve() return simplify(F->Type)->substitute(Sub);
return find(F->Type)->substitute(Sub);
} }
} }