#7541: Unavoidable duplicate constraint warning
Reporter:  blamario                           |          Owner:                 
    Type:  bug                                |         Status:  new            
Priority:  normal                             |      Component:  Compiler       
 Version:  7.6.1                              |       Keywords:                 
      Os:  Unknown/Multiple                   |   Architecture:  
 Failure:  Incorrect warning at compile-time  |      Blockedby:                 
Blocking:                                     |        Related:                 
 The "duplicate constraint" warning can be triggered in a context where
 it's impossible to remove it, because the constraints come with a type

 The following standalone little module reproduces the problem:

 {-# LANGUAGE FlexibleContexts, Rank2Types #-}

 module Test where

 type Constrained x y r = (Eq x, Eq y) => x -> y -> r

 f :: Constrained String String ()
 f = undefined

 The warning is

 Test.hs:7:6: Warning:
     Duplicate constraint(s): Eq String
     In the type signature for `f': f :: Constrained String String ()

 The warning is present in 7.4.1 and 7.6.1, and presumably in the versions
 between as well.

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

Glasgow-haskell-bugs mailing list

Reply via email to