
#12006: Can't infer constraint of pattern synonyms -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: TypeSynonyms | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Can't infer constraint of: {{{#!hs -- pattern Real' :: Num a => a -> Complex a pattern Real' r <- r :+ _ where Real' r = r :+ 0 }}} {{{ teR4.hs:12:25: error: … • No instance for (Num t) arising from the literal ‘0’ Possible fix: add (Num t) to the context of the type signature for: Main.$bReal' :: t -> Complex t • In the second argument of ‘(:+)’, namely ‘0’ In the expression: r :+ 0 In an equation for ‘$bReal'’: $bReal' r = r :+ 0 Compilation failed. }}} Should it be able to? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12006 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler