Fix simplifyType not expanding to the full solution

This commit is contained in:
Sam Vervaeck 2023-06-05 15:51:40 +02:00
parent 1147c751b9
commit d0b9c9702b
Signed by: samvv
SSH key fingerprint: SHA256:dIg0ywU1OP+ZYifrYxy8c5esO72cIKB+4/9wkZj1VaY

View file

@ -71,7 +71,10 @@ namespace bolt {
Type* Type::rewrite(std::function<Type*(Type*)> Fn, bool Recursive) {
auto Ty2 = Fn(this);
if (!Recursive && this != Ty2) {
if (this != Ty2) {
if (Recursive) {
return Ty2->rewrite(Fn, Recursive);
}
return Ty2;
}
switch (Kind) {