[GHC] #14547: Wrong warning by -Wincomplete-patterns
GHC
ghc-devs at haskell.org
Sat May 5 17:27:06 UTC 2018
#14547: Wrong warning by -Wincomplete-patterns
-------------------------------------+-------------------------------------
Reporter: YoshikuniJujo | Owner: (none)
Type: bug | Status: patch
Priority: low | Milestone:
Component: Compiler | Version: 8.2.1
Resolution: | Keywords: incomplete-
| patterns OverloadedLists,
| PatternMatchWarnings TypeFamilies
Operating System: Linux | Architecture: x86
Type of failure: Incorrect | Test Case:
error/warning at compile-time | deSugar/should_compile/T14547
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4624
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari <ben@…>):
In [changeset:"361d23a8ebb44f5df5167306d7b98d8bd1724e06/ghc" 361d23a/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="361d23a8ebb44f5df5167306d7b98d8bd1724e06"
Normalize the element type of ListPat, fix #14547
The element type of `List` maybe a type family instacen, rather than a
trivial type. For example in Trac #14547,
```
{-# LANGUAGE TypeFamilies, OverloadedLists #-}
class Foo f where
type It f
foo :: [It f] -> f
data List a = Empty | a :! List a deriving Show
instance Foo (List a) where
type It (List a) = a
foo [] = Empty
foo (x : xs) = x :! foo xs
```
Here the element type of `[]` is `It (List a)`, we should also normalize
it as `a`.
Test Plan: make test TEST="T14547"
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: thomie, carter
GHC Trac Issues: #14547
Differential Revision: https://phabricator.haskell.org/D4624
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14547#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list