@@ -270,8 +270,8 @@ verifyTotality (fc, n)
270270buildSCG :: (FC, Name) -> Idris ()
271271buildSCG (_, n) = do
272272 ist <- getIState
273− case lookupCtxt n (idris_callgraph ist) of
274− [cg] -> case lookupDefExact n (tt_ctxt ist) of
273+ case lookupCtxtExact n (idris_callgraph ist) of
274+ Just cg -> case lookupDefExact n (tt_ctxt ist) of
275275 Just (CaseOp _ _ _ pats _ cd) ->
276276 let (args, sc) = cases_compiletime cd in
277277 do logCoverage 2 $ "Building SCG for " ++ show n ++ " from\n"
@@ -280,8 +280,7 @@ buildSCG (_, n) = do
280280 logCoverage 5 $ "SCG is: " ++ show newscg
281281 addToCG n ( cg { scg = newscg } )
282282 _ -> return () -- CG comes from a type declaration only
283− [] -> logCoverage 5 $ "Could not build SCG for " ++ show n ++ "\n"
284− x -> error $ "buildSCG: " ++ show (n, x)
283+ _ -> logCoverage 5 $ "Could not build SCG for " ++ show n ++ "\n"
285284
286285delazy = delazy' False -- not lazy codata
287286delazy' all t@(App _ f a)