Skip to content

Commit

Permalink
Fix for GHC nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonchinn178 committed Jul 4, 2023
1 parent 11e97d5 commit 130bbea
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions aeson-schemas.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ extra-source-files:
test/goldens/ghc/9.2/getqq_missing_key.golden
test/goldens/ghc/9.4/getqq_missing_key.golden
test/goldens/ghc/9.6/getqq_missing_key.golden
test/goldens/ghc/9.7/getqq_missing_key.golden
test/goldens/README_Quickstart.golden
test/goldens/schemaqq_key_with_invalid_character.golden
test/goldens/schemaqq_key_with_trailing_escape.golden
Expand Down
4 changes: 4 additions & 0 deletions test/TestUtils/DeepSeq.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ instance NFData flag => NFData (TyVarBndr flag)
instance NFData TyVarBndr
#endif

#if MIN_VERSION_template_haskell(2,20,0) && __GLASGOW_HASKELL__ >= 907
instance NFData BndrVis
#endif

instance NFData Bytes

instance NFData (ForeignPtr a) where
Expand Down
4 changes: 3 additions & 1 deletion test/Tests/GetQQ.hs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ testFromJustErrors =
assertError msg x =
try @SomeException (x `deepseq` pure ()) >>= \case
Right _ -> error "Unexpectedly succeeded"
Left e -> (head . lines . show) e @?= msg
Left e
| line : _ <- (lines . show) e -> line @?= msg
| otherwise -> error "Exception had no message"

testListExpressions :: TestTree
testListExpressions =
Expand Down
18 changes: 18 additions & 0 deletions test/goldens/ghc/9.7/getqq_missing_key.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
test/wont-compile/GetMissingKey.hs:17:15: error: [GHC-64725]
• Key 'missing' does not exist in the following schema:
'[ '(Data.Aeson.Schema.Key.NormalKey "foo",
Data.Aeson.Schema.Type.SchemaScalar Bool)]
• In the second argument of ‘(.)’, namely
‘Data.Aeson.Schema.Internal.getKey
(Data.Proxy.Proxy :: Data.Proxy.Proxy "missing")’
In the expression:
(id
. Data.Aeson.Schema.Internal.getKey
(Data.Proxy.Proxy :: Data.Proxy.Proxy "missing"))
o
In an equation for ‘result’:
result
= ((id
. Data.Aeson.Schema.Internal.getKey
(Data.Proxy.Proxy :: Data.Proxy.Proxy "missing"))
o)

0 comments on commit 130bbea

Please sign in to comment.