summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T12067.hs
Commit message (Collapse)AuthorAgeFilesLines
* Deal correctly with unused imports for 'coerce'Simon Peyton Jones2016-06-281-0/+9
We only do newtype unwrapping for Coercible constraints if the newtype's data constructor is in scope. We were trying to record the fact that the data constructor was thereby 'used', so that an import statement would not be flagged as unnecsssary (by -Wunused-imports). But the code was simply wrong. It was wrong because it assumed that only one level of unwrapping happened, whereas tcTopNormaliseNewTypeTF_maybe actually unwraps multiple layers. So we need to return a /list/ of data constructors that are used. This entailed a bit of refactoring, as usual. Fixes Trac #12067