Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ fix #257 ] fix recursive record check #260

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Agda2Hs/Compile/Record.hs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,12 @@ compileRecord target def = do

checkUnboxPragma :: Defn -> C ()
checkUnboxPragma def
| Record{recFields} <- def
| Record{recFields, recMutual} <- def
, length (filter keepArg recFields) == 1
, not (recRecursive def)
-- , not (recRecursive def)
-- can be used again after agda 2.6.4.2 is released
-- see: agda/agda#7042
, all null recMutual -- see agda/agda#7042
= return ()

| otherwise
Expand Down
1 change: 1 addition & 0 deletions test/AllTests.agda
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import ModuleParametersImports
import Coerce
import Inlining
import EraseType
import Issue257

{-# FOREIGN AGDA2HS
import Issue14
Expand Down
7 changes: 7 additions & 0 deletions test/Issue257.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Issue257 where

open import Haskell.Prelude

record Wrap : Set where
field int : Integer
{-# COMPILE AGDA2HS Wrap unboxed #-}
Loading