`int` is not assignable to `int` (caused by inconsistent types when breaking cycles)
Type error assigning int to int in while loop. repro
Repro contents:
def decode(s: str):
i = 0
while i < len(s):
j = i
while (
s[j] != ""
):
j += 1
i = j + 1
@connernilsen Hey! I took a look at this issue and I think I found the rootcause.
With nested loops that have cyclic variable dependencies (j = i then i = j + 1), the type checker creates LoopRecursive type variables to handle the cycles. But when comparing types, it was rejecting these variables instead of using their underlying types, causing the false positive
I tried to fix it !!
Modified is_subset_eq in solver.rs ( to handle LoopRecursive variables appearing in the want position by using their prior type instead of throwing an internal error.
and its working shall i create a pr??
cc @stroxler for opinions on the approach
any update on this ?
I'm not 100% sure where the problem comes from (although there are two interlocking cycles here which I don't think is well-tested) so changing solver.rs to use prior types more aggressively is likely the solution.
So yes I think a PR would be helpful!
@stroxler @yangdanny97 could you please review it, apologies for taking two weeks!