[GHC] #15362: Template Haskell ignores bad type family definitions

#15362: Template Haskell ignores bad type family definitions -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Template | Version: 8.4.3 Haskell | 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: -------------------------------------+------------------------------------- This garbage is accepted: {{{#!hs data Nat = Zero | Succ Nat $( [d| type family a + b where Maybe Zero b = b Succ a + b = Succ (a + b) |] ) }}} Note the `Maybe` photo-bombing in the first equation. The problem is that TH uses the symbol declared in the family head for all the equations, ignoring what's actually there. This is sad. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15362 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15362: Template Haskell ignores bad type family definitions -------------------------------------+------------------------------------- Reporter: goldfire | Owner: mnguyen Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Template Haskell | Version: 8.4.3 Resolution: | Keywords: 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 mnguyen): * owner: (none) => mnguyen -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15362#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15362: Template Haskell ignores bad type family definitions
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: mnguyen
Type: bug | Status: closed
Priority: normal | Milestone: 8.8.1
Component: Template Haskell | Version: 8.4.3
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: th/T15362
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5229
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):
* status: new => closed
* testcase: => th/T15362
* differential: => Phab:D5229
* resolution: => fixed
* milestone: 8.10.1 => 8.8.1
Comment:
This was fixed in
[https://gitlab.haskell.org/ghc/ghc/commit/17bd163566153babbf51adaff8397f948a...
17bd163566153babbf51adaff8397f948ae363ca]:
{{{
Author: mynguyen

#15362: Template Haskell ignores bad type family definitions
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: mnguyen
Type: bug | Status: closed
Priority: normal | Milestone: 8.8.1
Component: Template Haskell | Version: 8.4.3
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: th/T15362
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5229
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg
participants (1)
-
GHC