[GHC] #12819: Pattern synonym signatures are not validity-checked
#12819: Pattern synonym signatures are not validity-checked -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC accepts Unknown/Multiple | invalid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Ponder this garbage: {{{#!hs {-# LANGUAGE PatternSynonyms, ViewPatterns, TypeFamilies, KindSignatures #-} module Bug where type family F a -- F :: * -> * data T :: (* -> *) -> * pattern Q :: T F -> String pattern Q x <- (undefined -> x) }}} This is accepted by GHC 8.0.1 and HEAD. But it has an unsaturated type family! Urk! The problem is that `TcSigs.tcPatSynSig` never does validity checking. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12819> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12819: Pattern synonym signatures are not validity-checked -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"8906e7b79a585039712034d9e88ca49f3cea6554/ghc" 8906e7b7/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="8906e7b79a585039712034d9e88ca49f3cea6554" Reshuffle levity polymorphism checks. Previously, GHC checked for bad levity polymorphism to the left of all arrows in data constructors. This was wrong, as reported in #12911 (where an example is also shown). The solution is to check each individual argument for bad levity polymorphism. Thus the check has been moved from TcValidity to TcTyClsDecls. A similar situation exists with pattern synonyms, also fixed here. This patch also nabs #12819 while I was in town. Test cases: typecheck/should_compile/T12911, patsyn/should_fail/T12819 Test Plan: ./validate Reviewers: simonpj, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2783 GHC Trac Issues: #12819, #12911 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12819#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12819: Pattern synonym signatures are not validity-checked -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.1 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.2.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12819#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12819: Pattern synonym signatures are not validity-checked -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.1 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | patsyn/should_fail/T12819 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * testcase: => patsyn/should_fail/T12819 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12819#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC