[GHC] #14851: "Pattern match has inaccessible right hand side" with TypeRep

#14851: "Pattern match has inaccessible right hand side" with TypeRep -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When I say {{{#!hs {-# LANGUAGE PatternSynonyms, ViewPatterns #-} module Bug where import Type.Reflection pattern X arg <- (checkFun -> arg) checkFun :: TypeRep fun -> a checkFun = undefined f x = case (x, True) of (X _, _) -> 5 _ -> 6 g x = case x of (X _) -> 5 _ -> 6 }}} I get {{{ Bug.hs:13:11: warning: [-Woverlapping-patterns] Pattern match has inaccessible right hand side In a case alternative: (X _, _) -> ... | 13 | (X _, _) -> 5 | ^^^^^^^^^^^^^ }}} I'm troubled by two things: 1. There's nothing inaccessible about my right-hand side. 2. This happens only for `f`, not `g`. If there's no tuple, there's no problem. Note that this problems requires `TypeRep`. Even another polykinded tycon (like `Proxy`) didn't trigger the problem. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14851 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14851: "Pattern match has inaccessible right hand side" with TypeRep -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: | PatternMatchWarnings, | 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 RyanGlScott): * keywords: => PatternMatchWarnings, PatternSynonyms -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14851#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC