[GHC] #9580: Possible excessive leniency in interaction between coerce and data families?

GHC ghc-devs at haskell.org
Thu Sep 11 23:31:07 UTC 2014


#9580: Possible excessive leniency in interaction between coerce and data
families?
-------------------------------------+-------------------------------------
              Reporter:  dmcclean    |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  low         |        Milestone:
             Component:  Compiler    |          Version:  7.8.3
  (Type checker)                     |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Oh yes, this is a real bug.  Here is a cut-down test case
 {{{
 {-# LANGUAGE KindSignatures, TypeFamilies #-}
 module T9580a( Dimensional ) where

 data family Dimensional var :: * -> *
 newtype instance Dimensional Int v = Quantity' v

 ------------------

 module T9680 where

 import T9580a
 import Data.Coerce

 foo :: Dimensional Int Double -> Double
 foo x = coerce x
 }}}
 Obviously, the latter module should fail to type check, since `Quantity'`
 is not in scope.

 Simon

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9580#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list