[GHC] #13671: Core lint error with PatternSynonyms and undefined

#13671: Core lint error with PatternSynonyms and undefined -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple PatternSynonyms | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I've submitted quite a few Core Lint errors lately, I don't have access to GHC HEAD so ignore this ticket if this has already been resolved {{{#!hs {-# Options_GHC -dcore-lint #-} {-# Language ViewPatterns, PatternSynonyms #-} import Data.Bifunctor.Fix import Data.Bifunctor.Tannen newtype ZipList a = ZL { getZipList :: Fix (Tannen Maybe (,)) a } pattern Nil :: ZipList a pattern Nil = ZL (In (Tannen Nothing)) infixr 5 ::: pattern (:::) :: a -> ZipList a -> ZipList a pattern a:::as <- ZL (In (Tannen (undefined -> (a, as)))) where a:::as = undefined }}} `↑` works fine without `-dcore-lint` but fails with it. Works fine if `undefined -> (a, as)` is replaced with `let x = x in x -> (a, as)`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13671 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13671: Core lint error with PatternSynonyms and undefined -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Iceland_jack): * Attachment "tQdW.log" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13671 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13671: Core lint error with PatternSynonyms and undefined -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: worksforme | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => worksforme Comment: I don't know precisely which `Data.Bifunctor.Fix` etc you mean, but I tried this {{{ {-# Options_GHC -dcore-lint #-} {-# Language ViewPatterns, PatternSynonyms #-} module T13671 where newtype ZipList a = ZL { getZipList :: Fix (Tannen Maybe (,)) a } pattern Nil :: ZipList a pattern Nil = ZL (In (Tannen Nothing)) infixr 5 ::: pattern (:::) :: a -> ZipList a -> ZipList a pattern a:::as <- ZL (In (Tannen (undefined -> (a, as)))) where a:::as = undefined newtype Tannen f p a b = Tannen { runTannen :: f (p a b) } newtype Fix p a = In { out :: p (Fix p a) a } }}} That compiles fine with `-dcore-lint`. So I'll close. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13671#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC