pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

Fix #1565: Handle LoopRecursive in is_subset_eq

Open AryanBagade opened this issue 1 month ago • 0 comments

Summary

This PR fixes a false positive type error in nested loops with cyclic variable dependencies.

Previously, when a LoopRecursive variable appeared as the want parameter in is_subset_eq, the type checker would throw an internal error, causing false positives like "int is not assignable to int" in nested while loops.

The fix handles the Variable::LoopRecursive case by extracting the prior type and continuing the subset check with the underlying type, instead of erroring.

Fixes #1565

Test Plan

  • ✅ Test with exact code from issue #1565 now passes

AryanBagade avatar Dec 01 '25 12:12 AryanBagade