#9085 closed bug (fixed)

Inaccessible equations in a closed type family should be a warning, not an error

Reported by: goldfire Owned by: goldfire
Priority: normal Milestone: 7.8.3
Component: Compiler Version: 7.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: indexed-types/should_compile/T9085
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

If I say

foo _     = ()
foo False = ()

I get

/Users/rae/temp/Bug.hs:2:1: Warning:
    Pattern match(es) are overlapped
    In an equation for ‘foo’: foo False = ...

But, if I say

{-# LANGUAGE TypeFamilies #-}

type family Foo a where
  Foo x    = ()
  Foo Bool = ()

I get

/Users/rae/temp/Bug.hs:5:3:
    Inaccessible family instance equation:
      Foo Bool = ()
    In the equations for closed type family ‘Foo’
    In the type family declaration for ‘Foo’

If this issues a warning at the term level, it probably should do the same at the type level.

This was my design decision that I'm changing, and I will fix. The warning will be controlled by the same flag that controls the term-level version.

Change History (5)

comment:1 Changed 14 months ago by goldfire

  • Test Case set to indexed-types/should_compile/T9085

comment:2 Changed 14 months ago by Richard Eisenberg <eir@…>

In 6a1d7f9736098d47463a71323d28ece792a59e52/ghc:

Fix #9085.

Inaccessible equations in a closed type family now leads to a
warning, not an error. This echoes what happens at the term level.

comment:3 Changed 14 months ago by Richard Eisenberg <eir@…>

comment:4 Changed 14 months ago by goldfire

  • Milestone set to 7.8.4
  • Status changed from new to merge

Recommending merge, but this is really minor.

comment:5 Changed 13 months ago by thoughtpolice

  • Milestone changed from 7.8.4 to 7.8.3
  • Resolution set to fixed
  • Status changed from merge to closed
Note: See TracTickets for help on using tickets.