Skip to content

Commit

Permalink
Fix TyVar BndrVis
Browse files Browse the repository at this point in the history
#2542 allowed `dhall`
to compile with template-haskell-2.21 and GHC-9.8 by adapting to the
addition of a binder visibility field on type variables.

Previously all binders were taken to be required, but in GHC-9.8 the
possibility of invisible binders was introduced.

The above patch mistakenly set all binders generated by Dhall to be
invisible, rather than default value of required. This changes the
semantics of the code and broke some examples in the test suite.

This patch fixes this by correctly setting binders to be BndrReq.

Resolves #2567
  • Loading branch information
TeofilC committed Dec 16, 2024
1 parent 063357f commit 2c8b751
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dhall/src/Dhall/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ toDeclaration generateOptions@GenerateOptions{..} haskellTypes typ =
interpretOptions = generateToInterpretOptions generateOptions typ

#if MIN_VERSION_template_haskell(2,21,0)
toTypeVar (V n i) = Syntax.PlainTV (Syntax.mkName (Text.unpack n ++ show i)) Syntax.BndrInvis
toTypeVar (V n i) = Syntax.PlainTV (Syntax.mkName (Text.unpack n ++ show i)) Syntax.BndrReq
#elif MIN_VERSION_template_haskell(2,17,0)
toTypeVar (V n i) = Syntax.PlainTV (Syntax.mkName (Text.unpack n ++ show i)) ()
#else
Expand Down

0 comments on commit 2c8b751

Please sign in to comment.