Fix unbound variables not being searched for in the solved type

This commit is contained in:
Sam Vervaeck 2024-07-11 21:03:32 +02:00
parent 71912f8c65
commit c1e1962cfd
Signed by: samvv
SSH key fingerprint: SHA256:dIg0ywU1OP+ZYifrYxy8c5esO72cIKB+4/9wkZj1VaY

View file

@ -475,8 +475,14 @@ auto getUnbound(const TypeEnv& Env, Type* Ty) {
Env(Env) {}
std::vector<TVar*> Out;
void visitVar(TVar* TV) {
if (!Env.hasVar(TV)) {
Out.push_back(TV);
auto Solved = TV->find();
if (isa<TVar>(Solved)) {
auto Var = static_cast<TVar*>(Solved);
if (!Env.hasVar(Var)) {
Out.push_back(Var);
}
} else {
visit(Solved);
}
}
} V { Env };