
#7857: GHC says there are unsafe overlapping instances, but only one instance applies -------------------------------+-------------------------------------------- Reporter: dmwit | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Changes (by simonpj): * status: new => closed * difficulty: => Unknown * resolution: => fixed Comment: Thanks. Happily, with HEAD I get {{{ T7857.hs:8:11: Could not deduce (PrintfType s0) arising from a use of ‛printf’ from the context (PrintfArg t) bound by the inferred type of g :: PrintfArg t => t -> s at T7857.hs:8:1-21 The type variable ‛s0’ is ambiguous Note: there are several potential instances: instance [safe] (PrintfArg a, PrintfType r) => PrintfType (a -> r) -- Defined in ‛Text.Printf’ instance [safe] PrintfType (IO a) -- Defined in ‛Text.Printf’ instance [safe] IsChar c => PrintfType [c] -- Defined in ‛Text.Printf’ In the second argument of ‛($)’, namely ‛printf "" i’ In the expression: f $ printf "" i In an equation for ‛g’: g i = f $ printf "" i }}} which seems very plausible. So I propose to close this as fixed; I don't think it's worth messing with the 7.6 branch. Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7857#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler