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
Fixes name shadowing error at keyFromRecordM for Primary keys #1496
Fixes name shadowing error at keyFromRecordM for Primary keys #1496
Conversation
@@ -141,6 +141,7 @@ import Database.Persist.ImplicitIdDef.Internal | |||
conp :: Name -> [Pat] -> Pat | |||
conp name pats = ConP name [] pats | |||
#else | |||
conp :: Name -> [Pat] -> Pat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes an annoying warning.
Unrelated but simple it's simple enough so I just keep it.
I could revert if you prefer.
@@ -10,6 +10,8 @@ | |||
{-# LANGUAGE TemplateHaskell #-} | |||
{-# LANGUAGE UndecidableInstances #-} | |||
|
|||
{-# OPTIONS_GHC -Wname-shadowing -Werror=name-shadowing #-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To verify the fixes actually work.
Just found sort of duplicated with #1494 |
Yeah, let's go with the |
- got the idea from yesodweb#1494
With the
given definition
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you!
With a persistent definition like,
the
keyFromRecordM
was generated likehence the name-shadowing error.
The fixes is simply append index to those variables, like
Before submitting your PR, check that you've:
stylish-haskell
on any changed files.After submitting your PR:
(unreleased)
on the Changelog