From fc1bf894c013ed6e3b15119422556b96f7e77fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Czajka?= <62751+lukaszcz@users.noreply.github.com> Date: Thu, 15 Sep 2022 10:33:01 +0200 Subject: [PATCH] Inductive types should depend on the types of their constructors (#1537) --- src/Juvix/Compiler/Abstract/Extra/DependencyBuilder.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Juvix/Compiler/Abstract/Extra/DependencyBuilder.hs b/src/Juvix/Compiler/Abstract/Extra/DependencyBuilder.hs index 4c76f50b9..4a12380fa 100644 --- a/src/Juvix/Compiler/Abstract/Extra/DependencyBuilder.hs +++ b/src/Juvix/Compiler/Abstract/Extra/DependencyBuilder.hs @@ -91,11 +91,11 @@ goStatement mn = \case mapM_ (goConstructorDef (i ^. inductiveName)) (i ^. inductiveConstructors) -- constructors of an inductive type depend on the inductive type, not the other --- way round +-- way round; an inductive type depends on the types of its constructors goConstructorDef :: Member (State DependencyGraph) r => Name -> InductiveConstructorDef -> Sem r () goConstructorDef indName c = do addEdge (c ^. constructorName) indName - goExpression (c ^. constructorName) (c ^. constructorType) + goExpression indName (c ^. constructorType) goFunctionClause :: Member (State DependencyGraph) r => Name -> FunctionClause -> Sem r () goFunctionClause p c = do