@@ -48,7 +48,7 @@ checkDef fc ns = do ctxt <- getContext
4848
4949-- | Elaborate a top-level type declaration - for example, "foo : Int -> Int".
5050elabType :: ElabInfo -> SyntaxInfo -> String ->
51− FC -> FnOpts -> Name -> PTerm -> Idris ()
51+ FC -> FnOpts -> Name -> PTerm -> Idris Type
5252elabType info syn doc fc opts n ty' = {- let ty' = piBind (params info) ty_in
5353 n = liftname info n_in in -}
5454 do checkUndefined fc n
@@ -102,6 +102,7 @@ elabType info syn doc fc opts n ty' = {- let ty' = piBind (params info) ty_in
102102 addIBC (IBCCoercion n)
103103 when corec $ do setAccessibility n Frozen
104104 addIBC (IBCAccess n Frozen)
105+ return nty
105106 where
106107 -- for making an internalapp, we only want the explicit ones, and don't
107108 -- want the parameters, so just take the arguments which correspond to the
@@ -1416,7 +1417,8 @@ elabInstance info syn fc cs n ps t expn ds
14161417 Nothing -> do mapM_ (checkNotOverlapping i t) (class_instances ci)
14171418 addInstance intInst n iname
14181419 Just _ -> addInstance intInst n iname
1419− elabType info syn "" fc [] iname t
1420+ tt_ty <- elabType info syn "" fc [] iname t
1421+ let nty = normalise (tt_ctxt i) [] tt_ty
14201422 let ips = zip (class_params ci) ps
14211423 let ns = case n of
14221424 NS n ns' -> ns'
@@ -1471,9 +1473,9 @@ elabInstance info syn fc cs n ps t expn ds
14711473 [t'] -> let tret = getRetType t
14721474 tret' = getRetType (delab i t') in
14731475 case matchClause i tret' tret of
1474− Right _ -> overlapping tret tret'
1476+ Right ms -> overlapping tret tret'
14751477 Left _ -> case matchClause i tret tret' of
1476− Right _ -> overlapping tret tret'
1478+ Right ms -> overlapping tret tret'
14771479 Left _ -> return ()
14781480 _ -> return ()
14791481 overlapping t t' = tclift $ tfail (At fc (Msg $
@@ -1622,6 +1624,7 @@ elabDecl' what info (PTy doc s f o n ty)
16221624 | what /= EDefns
16231625 = do iLOG $ "Elaborating type decl " ++ show n ++ show o
16241626 elabType info s doc f o n ty
1627+ return ()
16251628elabDecl' what info (PPostulate doc s f o n ty)
16261629 | what /= EDefns
16271630 = do iLOG $ "Elaborating postulate " ++ show n ++ show o