Bad error message when strictness annotations are used without BangPatterns pragma
Loading the program
powers n = go 1 where
go !k = k : go (k * n)
into GHCi results in an error:
*Main> :load "/home/manzyuk/tmp/example.hs"
[1 of 1] Compiling Main ( /home/manzyuk/tmp/example.hs, interpreted )
/home/manzyuk/tmp/example.hs:1:12: Not in scope: `go'
Failed, modules loaded: none.
The error message is plain wrong. The problem is fixed by enabling BangPatterns
pragma. It would be nice if GHC could suggest that like it does in many other similar cases.
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1
$ uname -a
Linux paddy 2.6.32-45-generic #104-Ubuntu SMP Tue Feb 19 21:20:09 UTC 2013 x86_64 GNU/Linux
Trac metadata
Trac field | Value |
---|---|
Version | 7.4.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |