Skip to content

Commit 6ada67d

Browse files
committed
fix: exclude generic types from recursivity checks
Our current recursion check introduced a bug whereby generic types receiving instances of themselves e.g. `(Trivial t)` would be identified as recursive and generate incorrect type emissions. For now, we simply don't consider generic types as recursive, though a future change will add recursivity support for these types as well.
1 parent 321b112 commit 6ada67d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/RecType.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ recInterfaceConstraints t =
6363

6464
-- | Returns true if a type member xobj is recursive (either through indirect recursion or "value" recursion)
6565
isRecursive :: Ty -> XObj -> Bool
66-
isRecursive (StructTy (ConcreteNameTy spath) _) (XObj (Sym path _) _ _) = spath == path
66+
isRecursive (StructTy (ConcreteNameTy spath) []) (XObj (Sym path _) _ _) = spath == path
6767
isRecursive rec (XObj (Lst xs) _ _) = any (isRecursive rec) xs
6868
isRecursive rec (XObj (Arr xs) _ _) = any (isRecursive rec) xs
6969
isRecursive _ _ = False

0 commit comments

Comments
 (0)