[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 
#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 
participants (1)
- 
                
GHC