on master help sign in
arity in Compiler a bit safer.
e8c6a5bMatus Tejiscak
src/IRTS/Compiler.hs+2−1
@@ -269,7 +269,8 @@ instance ToIR (TT Name) where
269 [TyDecl (DCon tag ar) _] -> ar
269 [TyDecl (DCon tag ar) _] -> ar
270 [TyDecl Ref ty] -> length $ getArgTys ty
270 [TyDecl Ref ty] -> length $ getArgTys ty
271 [Operator ty ar op] -> ar
271 [Operator ty ar op] -> ar
272− _ -> 0
272+ [] -> 0 -- no definition, probably local name => can't erase anything
273+ def -> error $ "unknown arity: " ++ show (n, def)
273
274
274 used = maybe [] (map fst . usedpos) $ lookupCtxtExact n (idris_callgraph ist)
275 used = maybe [] (map fst . usedpos) $ lookupCtxtExact n (idris_callgraph ist)
275 fst4 (x,_,_,_) = x
276 fst4 (x,_,_,_) = x