on master help sign in
Broaden cover of getArity.
commitb7d5cbc2bffc162c3737480c84be1c773e867ba3 authorMatus Tejiscak <ziman@functor.sk> dateWed 26 Feb 2014, 14:06 (13 years ago) parent7f5043a
2 files changed+2
src/IRTS/Compiler.hs+1 src/Idris/Erasure.hs+1
src/IRTS/Compiler.hs+1
@@ -267,6 +267,7 @@ instance ToIR (TT Name) where
267267 arity = case fst4 <$> lookupCtxt n (definitions . tt_ctxt $ ist) of
268268 [CaseOp ci ty tys def tot cdefs] -> length tys
269269 [TyDecl (DCon tag ar) _] -> ar
270+ [TyDecl Ref ty] -> length $ getArgTys ty
270271 [Operator ty ar op] -> ar
271272 _ -> 0
272273
src/Idris/Erasure.hs+1
@@ -395,6 +395,7 @@ buildDepMap ci ctx mainName = addPostulates $ dfs S.empty M.empty [mainName]
395395 getArity n = case lookupDef n ctx of
396396 [CaseOp ci ty tys def tot cdefs] -> length tys
397397 [TyDecl (DCon tag arity) _] -> arity
398+ [TyDecl (Ref) ty] -> length $ getArgTys ty
398399 [Operator ty arity op] -> arity
399400 df -> error $ "unknown entity " ++ show n ++ ": " ++ show df
400401