#2032: SCC annotations cause compile errors
-------------------------+--------------------------------------------------
Reporter: m4dc4p | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.8.2
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: Unknown | Os: Windows
-------------------------+--------------------------------------------------
The following program will not compile:
bad s = take 10 . {-# SCC "foo" #-} drop 10 $ s
It fails with the message
{{{
Couldn't match expected type `a -> [a1]'
against inferred type `[a2]'
In the second argument of `(.)', namely `(drop 10 $ s)'
In the expression: take 10 . (drop 10 $ s)
In the definition of `bad': bad s = take 10 . (drop 10 $ s)
}}}
However, if the SCC annotation is removed it compiles:
good s = take 10 . drop 10 $ s
Adding parentheses can also fix it:
good2 s = take 10 . ({-# SCC "foo" #-} drop 10) $ s
but it's still annoying that adding an annotation can cause compilation to
fail.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2032>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs