[GHC] #14984: Rgression: 8.4.1 says "Could not deduce" when before 8.4 it could

GHC ghc-devs at haskell.org
Thu Mar 29 08:14:49 UTC 2018


#14984: Rgression: 8.4.1 says "Could not deduce" when before 8.4 it could
-------------------------------------+-------------------------------------
           Reporter:  erikd          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.4.1
  (Type checker)                     |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  GHC rejects
  Unknown/Multiple                   |  valid program
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Have some code:

 {{{#!hs
 import           Test.QuickCheck
 import           Test.QuickCheck.Monadic

 testPropertyIO :: Testable a => PropertyM IO a -> Property
 testPropertyIO = monadicIO . (=<<) stop
 }}}

 That compiles fine with ghc 7.10 through 8.2, but with 8.4.1 fails with:
 {{{
 test/Test/Mafia/IO.hs:18:18: error:
     ? Could not deduce (Testable a0) arising from a use of ?monadicIO?
       from the context: Testable a
         bound by the type signature for:
                    testPropertyIO :: forall a.
                                      Testable a =>
                                      PropertyM IO a -> Property
         at test/Test/Mafia/IO.hs:17:1-58
       The type variable ?a0? is ambiguous
       These potential instances exist:
         instance [safe] Testable prop => Testable (Gen prop)
           -- Defined in ?Test.QuickCheck.Property?
         instance [safe] Testable Discard
           -- Defined in ?Test.QuickCheck.Property?
         instance [safe] Testable Property
           -- Defined in ?Test.QuickCheck.Property?
         ...plus three others
         ...plus two instances involving out-of-scope types
         (use -fprint-potential-instances to see them all)
     ? In the first argument of ?(.)?, namely ?monadicIO?
       In the expression: monadicIO . (=<<) stop
       In an equation for ?testPropertyIO?:
           testPropertyIO = monadicIO . (=<<) stop
 }}}

 Either the compiler has been incorrectly accepting this as valid for a
 number of releases or this is a regression.

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


More information about the ghc-tickets mailing list