fix errors with alias analysis

This commit is contained in:
Brendan Hansknecht 2023-04-06 20:41:04 -07:00
parent 6302a8d4b5
commit 2e2b687fac
No known key found for this signature in database
GPG key ID: 0EA784685083E75B

View file

@ -1785,7 +1785,9 @@ fn solve(
);
if let Success { .. } = unify(
&mut UEnv::new(subs),
// TODO: if we don't clone and a later branch matches, we will get a failure in alias analysis.
// That said, I assume cloning is expensive and should be avoided.
&mut UEnv::new(&mut subs.clone()),
actual,
Variable::LIST_U8,
Mode::EQ,
@ -1794,7 +1796,7 @@ fn solve(
// List U8 always valid.
state
} else if let Success { .. } = unify(
&mut UEnv::new(subs),
&mut UEnv::new(&mut subs.clone()),
actual,
Variable::STR,
Mode::EQ,