Skip to content

Commit

Permalink
fix recursive record check
Browse files Browse the repository at this point in the history
  • Loading branch information
flupe authored and jespercockx committed Dec 26, 2023
1 parent 07c9d3d commit daf6fe1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
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 #-}

0 comments on commit daf6fe1

Please sign in to comment.