Closed benbellick closed 1 year ago
the fix looks good but the test doesn't show it. OverloadedRecordDot
is not default enabled so in issue1471 = (x.y)
, (x.y)
is parsed to a parenthesized function composition and will generate a redundant brackets hint both before your fix and after it.
i suggest these tests from #1471:
-- no record dot syntax
referenceDesignator = ReferenceDesignator (p.placementReferenceDesignator)
-- record dot syntax
{-# LANGUAGE OverloadedRecordDot #-} \
referenceDesignator = ReferenceDesignator (p.placementReferenceDesignator) -- p.placementReferenceDesignator
as reported in the ticket, for the second test, before your fix it won't generate a redundant bracket hint but after your fix it will!
Hey Shayne, thanks for the comments! I have updated the tests. Just to be clear, in the first case (w/o record dot syntax), the expression p.placementReferenceDesignator is parsed as p . placementReferenceDesignator, i.e. as two functions combined with the composition operator .. Is that correct?
Just to be clear, in the first case (w/o record dot syntax), the expression
p.placementReferenceDesignator
is parsed asp . placementReferenceDesignator
, i.e. as two functions combined with the composition operator.
. Is that correct?
yes. if OverloadedRecordDot
is not in effect the .
in the expression above is parsed as an ITdot
token which denotes function composition.
It seems that OverloadedRecordDot was added in version 9.2, so version 9.0 is perhaps causing a test failure. Any suggestion on how to deal with this? Perhaps a way to ignore certain tests based off of version?
@benbellick if the second test were updated to
-- record dot syntax
{-# LANGUAGE OverloadedRecordDot #-} \
referenceDesignator = ReferenceDesignator (p.placementReferenceDesignator) -- @Warning p.placementReferenceDesignator @NoRefactor: refactor requires GHC >= 9.2.1
i think it will pass the currently failing 9.0 test.
@shayne-fletcher Thanks for the help. I have updated the test!
Thanks for contributing to hlint!
My pleasure! I love Haskell and hope to keep contributing to the community however I can. Thanks for the help!
This is to resolve issue #1471