@@ -112,13 +112,23 @@ elabRecord info syn fc tyn ty cn cty
112112 let nonImp = mapMaybe isNonImp (zip cimp ptys_u)
113113 let implBinds = getImplB id cty'
114114 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)
116117 where
117118-- syn = syn_in { syn_namespace = show (nsroot tyn) : syn_namespace syn_in }
118119
119120 isNonImp (PExp _ _ _, a) = Just a
120121 isNonImp _ = Nothing
121122
123+ tryElabDecl info (fn, ty, val)
124+ = do i <- get
125+ idrisCatch (do elabDecl' info ty
126+ elabDecl' info val)
127+ (\v -> do iputStrLn $ show fc ++
128+ ":Warning - can't generate setter for " ++
129+ show fn ++ " (" ++ show ty ++ ")"
130+ put i)
131+
122132 getImplB k (PPi (Imp l s) n Placeholder sc)
123133 = getImplB k sc
124134 getImplB k (PPi (Imp l s) n ty sc)
@@ -188,7 +198,7 @@ elabRecord info syn fc tyn ty cn cty
188198 []
189199 (PApp fc (PRef fc cn)
190200 (map pexp rhsArgs)) []
191− return [pfnTy, PClauses fc [] setname [pclause]]
201+ return (pn, pfnTy, PClauses fc [] setname [pclause])
192202
193203elabCon :: ElabInfo -> SyntaxInfo -> Name -> (Name, PTerm, FC) -> Idris (Name, Type)
194204elabCon info syn tn (n, t_in, fc)
@@ -390,7 +400,7 @@ elabClause info tcgen (PClause fc fname lhs_in withs rhs_in whereblock)
390400 logLvl 5 (showImp True (expandParams decorate newargs decls rhs_in))
391401 let rhs = addImplBound i (map fst newargs)
392402 (expandParams decorate newargs decls rhs_in)
393− logLvl 2 (showImp True rhs)
403+ logLvl 2 $ "RHS: " ++ showImp True rhs
394404 ctxt <- getContext -- new context with where block added
395405 logLvl 5 "STARTING CHECK"
396406 ((rhs', defer, is), _) <-