1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-05 22:46:08 +03:00

Inductive types should depend on the types of their constructors (#1537)

This commit is contained in:
Łukasz Czajka 2022-09-15 10:33:01 +02:00 committed by GitHub
parent dab4b6fc0f
commit fc1bf894c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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