#6030: Typeclass constraint should pick the OverloadedString type.
------------------------------+---------------------------------------------
Reporter: GregWeber | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.4.1 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Testcase:
Blockedby: | Blocking:
Related: |
------------------------------+---------------------------------------------
{{{
{-# LANGUAGE OverloadedStrings #-}
import Data.Text as T
class NoDefault a where noDefault :: a -> Text
instance NoDefault T.Text where noDefault = id
main = print (noDefault "Hello!")
}}}
{{{
default.hs:7:15:
Ambiguous type variable `a0' in the constraints:
(NoDefault a0) arising from a use of `noDefault'
at default.hs:7:15-23
(Data.String.IsString a0) arising from the literal `"Hello!"'
at default.hs:7:25-32
Probable fix: add a type signature that fixes these type variable(s)
In the first argument of `print', namely `(noDefault "Hello!")'
In the expression: print (noDefault "Hello!")
In an equation for `main': main = print (noDefault "Hello!")
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6030>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs