[GHC] #11264: Previously compiling example does not compile
#11264: Previously compiling example does not compile -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11264> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11264: Previously compiling example does not compile -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | typecheck/should_compile/ClassOperator Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * testcase: => typecheck/should_compile/ClassOperator * failure: None/Unknown => GHC rejects valid program * milestone: => 8.0.1 * priority: normal => high Old description: New description: The example in the testcase introduced in Phab:D1667 currently fails with, {{{ ClassOperator.hs:12:3: error: • Could not deduce (a ><> b0) from the context: a ><> b bound by the type signature for: (**>) :: (a ><> b) => a -> a -> () at ClassOperator.hs:12:3-44 The type variable ‘b0’ is ambiguous • In the ambiguity check for ‘**>’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes When checking the class method: (**>) :: forall a b. (a ><> b) => a -> a -> () In the class declaration for ‘><>’ ClassOperator.hs:12:3: error: • Could not deduce (a ><> b0) from the context: a ><> b bound by the type signature for: (**<) :: (a ><> b) => a -> a -> () at ClassOperator.hs:12:3-44 The type variable ‘b0’ is ambiguous • In the ambiguity check for ‘**<’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes When checking the class method: (**<) :: forall a b. (a ><> b) => a -> a -> () In the class declaration for ‘><>’ ClassOperator.hs:12:3: error: • Could not deduce (a ><> b0) from the context: a ><> b bound by the type signature for: (>**) :: (a ><> b) => a -> a -> () at ClassOperator.hs:12:3-44 The type variable ‘b0’ is ambiguous • In the ambiguity check for ‘>**’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes When checking the class method: (>**) :: forall a b. (a ><> b) => a -> a -> () In the class declaration for ‘><>’ ClassOperator.hs:12:3: error: • Could not deduce (a ><> b0) from the context: a ><> b bound by the type signature for: (<**) :: (a ><> b) => a -> a -> () at ClassOperator.hs:12:3-44 The type variable ‘b0’ is ambiguous • In the ambiguity check for ‘<**’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes When checking the class method: (<**) :: forall a b. (a ><> b) => a -> a -> () In the class declaration for ‘><>’ }}} This is a regression relative to 7.10.2, which accepts the program without error. -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11264#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11264: Previously compiling example does not compile -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | typecheck/should_compile/ClassOperator Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"9f23dd9d05eb0945fa7a60492d2f2721d364327b/ghc" 9f23dd9/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="9f23dd9d05eb0945fa7a60492d2f2721d364327b" testsuite: Add ClassOperator testcase This is derived from Haddock's `Operators` `html-test`, which appears to fail with GHC master yet compiles with 7.10.2 Reviewers: simonpj, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1667 GHC Trac Issues: #11264 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11264#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11264: Previously compiling example does not compile -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | typecheck/should_compile/ClassOperator Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): The error message is quite right. Here's an excerpt {{{ class C a b where (**>) :: a -> a -> () }}} The type of `(**>)` is ambiguous, because nothing fixes `b`. You could remove a parameter from the class, or add a functional dependency. Anyway the error message looks spot on. Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11264#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11264: Previously compiling example does not compile -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | typecheck/should_compile/ClassOperator Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => invalid Comment: Ahh, of course. I should have looked more closely at the example. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11264#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11264: Previously compiling example does not compile -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | typecheck/should_compile/ClassOperator Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): Then the test should be deleted, or at least not marked expect_broken. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11264#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11264: Previously compiling example does not compile -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | typecheck/should_compile/ClassOperator Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"fd1b5ae701bf3f0de5d2a56a7320b68d4f66b510/ghc" fd1b5ae/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="fd1b5ae701bf3f0de5d2a56a7320b68d4f66b510" testsuite/ClassOperator: This actually should_fail See #11264 for details. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11264#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC