Skip to content

Commit

Permalink
agda#6972: Also save backcopies in interface file (agda#6974)
Browse files Browse the repository at this point in the history
  • Loading branch information
plt-amy authored and JobPetrovcic committed Apr 12, 2024
1 parent 350f721 commit 2db2f71
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/full/Agda/Interaction/Imports.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,9 @@ buildInterface src topLevel = do
let
mh = moduleNameId (srcModuleName src)
opaqueBlocks = Map.filterWithKey (\(OpaqueId _ mod) _ -> mod == mh) opaqueBlocks'
opaqueIds = Map.filterWithKey (\_ (OpaqueId _ mod) -> mod == mh) opaqueIds'
isLocal qnm = case nameId (qnameName qnm) of
NameId _ mh' -> mh' == mh
opaqueIds = Map.filterWithKey (\qnm (OpaqueId _ mod) -> isLocal qnm || mod == mh) opaqueIds'

-- Andreas, 2015-02-09 kill ranges in pattern synonyms before
-- serialization to avoid error locations pointing to external files
Expand Down
1 change: 0 additions & 1 deletion src/full/Agda/TypeChecking/Opacity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ saturateOpaqueBlocks moddecs = entry where
canonise name = fromMaybe name (HashMap.lookup name canonical)
ours = snd <$> filter isOurs (Map.toAscList known)

unless (null ours) $ do
() <- liftIO $ evaluate (rnf (canonical, backcopies))

reportSDoc "tc.opaque" 30 $ vcat $
Expand Down
5 changes: 5 additions & 0 deletions test/Succeed/Issue6972a.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Issue6972a (A : Set₁) where

opaque
B : Set₁
B = A
3 changes: 3 additions & 0 deletions test/Succeed/Issue6972b.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Issue6972b (A : Set₁) where

open import Issue6972a A public
11 changes: 11 additions & 0 deletions test/Succeed/Issue6972c.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Issue6972c where

open import Agda.Builtin.Equality

open import Issue6972b Set

opaque
unfolding B

_ : B ≡ Set
_ = refl

0 comments on commit 2db2f71

Please sign in to comment.