Skip to content

Commit

Permalink
Fix agda#6729: clear loneSigs before inferring mutual blocks in an op…
Browse files Browse the repository at this point in the history
…aque block.
  • Loading branch information
szumixie authored and JobPetrovcic committed Apr 12, 2024
1 parent 88bb4f0 commit 3b26a97
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/full/Agda/Syntax/Concrete/Definitions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,11 @@ niceDeclarations fixs ds = do
-- The body of an 'opaque' definition can have mutual
-- recursion by interleaving type signatures and definitions,
-- just like the body of a module.
body <- inferMutualBlocks =<< nice body
decls0 <- nice body
ps <- use loneSigs
checkLoneSigs ps
let decls = replaceSigs ps decls0
body <- inferMutualBlocks decls
pure ([NiceOpaque r (concat unfoldings) body], ds)

Unfolding r _ -> declarationException $ UnfoldingOutsideOpaque r
Expand Down
2 changes: 2 additions & 0 deletions test/Fail/Issue6729.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
opaque
test : Set
10 changes: 10 additions & 0 deletions test/Fail/Issue6729.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Issue6729.agda:1,1-2,13
warning: -W[no]UselessOpaque
This 'opaque' block has no effect.
when scope checking the declaration
opaque
unfolding {}
test : Set
Issue6729.agda:2,3-7
The following names are declared but not accompanied by a
definition: test

0 comments on commit 3b26a97

Please sign in to comment.