Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Agda2Lambox/Compile/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Agda.Syntax.Common.Pretty ( prettyShow )
import Agda.Utils.Monad (ifM)

import qualified LambdaBox as LBox
import Agda2Lambox.Compile.Utils ( qnameToKName, isLogical )
import Agda2Lambox.Compile.Utils ( qnameToKName, isLogical, toInductive )
import Agda2Lambox.Compile.Monad
import Agda.Compiler.Backend (HasConstInfo(getConstInfo), Definition(Defn), AddContext (addContext))
import Agda.Utils (isDataOrRecDef, getInductiveParams, isArity, maybeUnfoldCopy)
Expand Down Expand Up @@ -142,8 +142,9 @@ compileTypeTerm = \case
if isLogicalDef then pure ([], LBox.TBox)

-- if it's an inductive, we only apply the parameters
else if isDataOrRecDef def then
([],) . foldl' LBox.TApp (LBox.TConst $ qnameToKName q)
else if isDataOrRecDef def then do
ind <- liftTCM $ toInductive q
([],) . foldl' LBox.TApp (LBox.TInd ind)
<$> compileElims (take (getInductiveParams def) es)

-- TODO: check if it is a type alias
Expand Down