@@ -112,13 +112,23 @@ elabRecord info syn fc tyn ty cn cty
112 let nonImp = mapMaybe isNonImp (zip cimp ptys_u)
112 let nonImp = mapMaybe isNonImp (zip cimp ptys_u)
113 let implBinds = getImplB id cty'
113 let implBinds = getImplB id cty'
114 update_decls <- mapM (mkUpdate recty implBinds (length nonImp)) (zip nonImp [0..])
114 update_decls <- mapM (mkUpdate recty implBinds (length nonImp)) (zip nonImp [0..])
115− mapM_ (elabDecl info) (concat (proj_decls ++ update_decls))
115+ mapM_ (elabDecl info) (concat proj_decls)
116+ mapM_ (tryElabDecl info) (update_decls)
117-- syn = syn_in { syn_namespace = show (nsroot tyn) : syn_namespace syn_in }
118-- syn = syn_in { syn_namespace = show (nsroot tyn) : syn_namespace syn_in }
119 isNonImp (PExp _ _ _, a) = Just a
120 isNonImp (PExp _ _ _, a) = Just a
120 isNonImp _ = Nothing
121 isNonImp _ = Nothing
123+ tryElabDecl info (fn, ty, val)
125+ idrisCatch (do elabDecl' info ty
127+ (\v -> do iputStrLn $ show fc ++
128+ ":Warning - can't generate setter for " ++
129+ show fn ++ " (" ++ show ty ++ ")"
122 getImplB k (PPi (Imp l s) n Placeholder sc)
132 getImplB k (PPi (Imp l s) n Placeholder sc)
123 = getImplB k sc
133 = getImplB k sc
124 getImplB k (PPi (Imp l s) n ty sc)
134 getImplB k (PPi (Imp l s) n ty sc)
@@ -188,7 +198,7 @@ elabRecord info syn fc tyn ty cn cty
189 (PApp fc (PRef fc cn)
199 (PApp fc (PRef fc cn)
190 (map pexp rhsArgs)) []
200 (map pexp rhsArgs)) []
191− return [pfnTy, PClauses fc [] setname [pclause]]
201+ return (pn, pfnTy, PClauses fc [] setname [pclause])
193elabCon :: ElabInfo -> SyntaxInfo -> Name -> (Name, PTerm, FC) -> Idris (Name, Type)
203elabCon :: ElabInfo -> SyntaxInfo -> Name -> (Name, PTerm, FC) -> Idris (Name, Type)
194elabCon info syn tn (n, t_in, fc)
204elabCon info syn tn (n, t_in, fc)
@@ -390,7 +400,7 @@ elabClause info tcgen (PClause fc fname lhs_in withs rhs_in whereblock)
390 logLvl 5 (showImp True (expandParams decorate newargs decls rhs_in))
400 logLvl 5 (showImp True (expandParams decorate newargs decls rhs_in))
391 let rhs = addImplBound i (map fst newargs)
401 let rhs = addImplBound i (map fst newargs)
392 (expandParams decorate newargs decls rhs_in)
402 (expandParams decorate newargs decls rhs_in)
393− logLvl 2 (showImp True rhs)
403+ logLvl 2 $ "RHS: " ++ showImp True rhs
394 ctxt <- getContext -- new context with where block added
404 ctxt <- getContext -- new context with where block added
395 logLvl 5 "STARTING CHECK"
405 logLvl 5 "STARTING CHECK"
396 ((rhs', defer, is), _) <-
406 ((rhs', defer, is), _) <-