on master help sign in
Broaden cover of getArity.
b7d5cbcMatus Tejiscak
src/IRTS/Compiler.hs+1
@@ -267,6 +267,7 @@ instance ToIR (TT Name) where
267 arity = case fst4 <$> lookupCtxt n (definitions . tt_ctxt $ ist) of
267 arity = case fst4 <$> lookupCtxt n (definitions . tt_ctxt $ ist) of
268 [CaseOp ci ty tys def tot cdefs] -> length tys
268 [CaseOp ci ty tys def tot cdefs] -> length tys
269 [TyDecl (DCon tag ar) _] -> ar
269 [TyDecl (DCon tag ar) _] -> ar
270+ [TyDecl Ref ty] -> length $ getArgTys ty
270 [Operator ty ar op] -> ar
271 [Operator ty ar op] -> ar
271 _ -> 0
272 _ -> 0
272
273
src/Idris/Erasure.hs+1
@@ -395,6 +395,7 @@ buildDepMap ci ctx mainName = addPostulates $ dfs S.empty M.empty [mainName]
395 getArity n = case lookupDef n ctx of
395 getArity n = case lookupDef n ctx of
396 [CaseOp ci ty tys def tot cdefs] -> length tys
396 [CaseOp ci ty tys def tot cdefs] -> length tys
397 [TyDecl (DCon tag arity) _] -> arity
397 [TyDecl (DCon tag arity) _] -> arity
398+ [TyDecl (Ref) ty] -> length $ getArgTys ty
398 [Operator ty arity op] -> arity
399 [Operator ty arity op] -> arity
399 df -> error $ "unknown entity " ++ show n ++ ": " ++ show df
400 df -> error $ "unknown entity " ++ show n ++ ": " ++ show df
400
401