File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ compileClause'' curModule projName x ty c@Clause{..} = do
236236 let withWhereModule = case children of
237237 [] -> id
238238 (c: _) -> addWhereModule $ qnameModule c
239- whereDecls <- withWhereModule $ compileLocal $ mapM (getConstInfo >=> compileFun' True ) children
239+ whereDecls <- withWhereModule $ compileLocal $ mapM compileWhereDef children
240240
241241 let Just body = clauseBody
242242 Just (unArg -> typ) = clauseType
@@ -250,6 +250,13 @@ compileClause'' curModule projName x ty c@Clause{..} = do
250250 (Hs. Symbol {}, p : q : ps) -> Hs. InfixMatch () p x (q : ps) rhs whereBinds
251251 _ -> Hs. Match () x ps rhs whereBinds
252252 return $ Just match
253+ where
254+ compileWhereDef f = do
255+ def <- getConstInfo f
256+ case theDef def of
257+ Function {} -> compileFun' def
258+ def -> agda2hsErrorM $
259+ " Cannot compile" <+> prettyTCM f <+> " in a `where` block"
253260
254261keepClause :: Clause -> C Bool
255262keepClause c@ Clause {.. } = case (clauseBody, clauseType) of
Original file line number Diff line number Diff line change 1+ open import Haskell.Prelude
2+
3+ module Fail.Issue443 where
4+
5+ test : ⊤
6+ test = local
7+ where postulate local : ⊤
8+
9+ {-# COMPILE AGDA2HS test #-}
Original file line number Diff line number Diff line change 1+ test/Fail/Issue443.agda:5.1-5: error: [CustomBackendError]
2+ agda2hs: Cannot compile Fail.Issue443.local in a `where` block
You can’t perform that action at this time.
0 commit comments