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

Incorrect "Use const" when using named field puns #536

Closed
alex-rozenshteyn-leapyear opened this issue Sep 26, 2018 · 2 comments
Closed

Incorrect "Use const" when using named field puns #536

alex-rozenshteyn-leapyear opened this issue Sep 26, 2018 · 2 comments

Comments

@alex-rozenshteyn-leapyear

Related to #483:

{-# LANGUAGE NamedFieldPuns #-}
data Foo = Foo {x :: Int, y :: Int}
foo = \x -> Foo{x, y=1}
Suggestion: Use const
Found:
  \ x -> Foo{x, y = 1}
Perhaps:
  const Foo{x, y = 1}
@ndmitchell
Copy link
Owner

Thanks for the report! A bug in an upstream dependency - I raised a PR at pepeiborra/haskell-src-exts-util#11 (while it's an upstream dependency, it was my bug that got moved into a separate repo, so entirely my fault!)

@ndmitchell
Copy link
Owner

ndmitchell commented May 2, 2020

Interestingly a bug I just came across and fixed as part of a different ticket. I've checked your code and it works now. See #745 for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants