[GHC] #16059: checkValidType is defeated by a type synonym

GHC ghc-devs at haskell.org
Thu Jan 10 20:05:19 UTC 2019


#16059: checkValidType is defeated by a type synonym
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.10.1
       Component:  Compiler (Type    |              Version:  8.7
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:  16140
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 It turns out that option (1) from comment:4 is just plain infeasible. If
 you implement it, then several test cases that should fail suddenly pass.
 `tcfail129` is one example:

 {{{#!hs
 module ShouldFail where

 data T = T

 -- This was erroneously accepted
 type Foo a = String -> Maybe a
 type Bar m = m Int
 blah = undefined :: Bar Foo


 type Foo1 a = Maybe a
 type Bar1 m = m Int
 blah1 = undefined :: Bar1 Foo1
 }}}

 This should fail due to the unsaturated use of `Foo`/`Foo1`, but if we
 always expand, then we'll never catch that!

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


More information about the ghc-tickets mailing list