#14547: Wrong warning by -Wincomplete-patterns -------------------------------------+------------------------------------- Reporter: YoshikuniJujo | Owner: (none) Type: bug | Status: closed Priority: low | Milestone: 8.6.1 Component: Compiler | Version: 8.2.1 Resolution: fixed | 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:"ba6e445e1cf31957f2a327a73f9f66cfa7f24e26/ghc" ba6e445/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="ba6e445e1cf31957f2a327a73f9f66cfa7f24e26" Normalize the element type of ListPat, fix #14547 Summary: 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:17> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler