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

#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

#14984: Regression: 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 (Type | Version: 8.4.1 checker) | Resolution: | 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: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): I must be missing something, because this program does not typecheck for me on GHC 8.2.2 //or// 8.4.1: {{{ $ /opt/ghc/8.2.2/bin/ghci Bug2.hs GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Main ( Bug2.hs, interpreted ) Bug2.hs:5: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 Bug2.hs:4: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 | 5 | testPropertyIO = monadicIO . (=<<) stop | ^^^^^^^^^ Failed, no modules loaded. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14984#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14984: Regression: 8.4.1 says "Could not deduce" when before 8.4 it could -------------------------------------+------------------------------------- Reporter: erikd | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 8.4.1 checker) | Resolution: invalid | 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: | -------------------------------------+------------------------------------- Changes (by erikd): * status: new => closed * resolution: => invalid Comment: Sorry, this was my mistake. This was caused by a change in `QuickCheck` between `2.9.*` and `2.10.0` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14984#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC