[Haskell-cafe] RE: No warning in GHC
simonpj at microsoft.com
Mon Mar 22 04:47:50 EDT 2010
[Redirecting to haskell-cafe]
With -Wall I get
bash-3.2$ ghc -c -Wall Foo.hs
Warning: Definition but no type signature for `func'
Inferred type: func :: forall t t1. (Num t1) => t -> t1
Foo.hs:3:5: Warning: Defined but not used: `x'
Warning: This binding for `x' shadows the existing binding
bound at Foo.hs:3:5
| -----Original Message-----
| From: cvs-ghc-bounces at haskell.org [mailto:cvs-ghc-bounces at haskell.org] On Behalf Of
| Grigory Sarnitskiy
| Sent: 21 March 2010 19:37
| To: cvs-ghc at haskell.org
| Subject: No warning in GHC
| Hello! I wonder, why GHC shows no warning in situations like
| func x = x
| where x = 5
| Sometimes I forget about argument names used, and use the same names in let or where.
| And it can take me quite a lot time to understand what is wrong. I think it would be
| nice to warn users if the argument is "redefined" in let/where clause. Shall I report
| a bug/feature request? I'm using ghc 6.10.4.
| btw, I couldn't post to IRC: #ghc :Cannot send to channel
| Cvs-ghc mailing list
| Cvs-ghc at haskell.org
More information about the Haskell-Cafe