diff options
author | simonpj@microsoft.com <unknown> | 2010-09-19 15:33:27 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2010-09-19 15:33:27 +0000 |
commit | e8fa04cf0d656c4a2ff737278b8cea9fce3b5a2b (patch) | |
tree | 96e6fae220b61ffeb4070d652a8b53fd0ab4a79f /compiler/hsSyn | |
parent | e4b5abb6ddfd07a7f95455c94faf2946a1bc078e (diff) | |
download | haskell-e8fa04cf0d656c4a2ff737278b8cea9fce3b5a2b.tar.gz |
Add a flag -fwarn-missing-local-sigs, and improve -fwarn-mising-signatures
The new flag prints out a warning if you have a local,
polymorphic binding that lacks a type signature. It's meant
to help with the transition to the new typechecker, which
discourages local let-generalisation.
At the same time I moved the missing-signature code to TcHsSyn,
where it takes place as part of zonking. That way the
types are reported after all typechecking is complete,
thereby fixing Trac #3696. (It's even more important for
local bindings, which is why I made the change.)
Diffstat (limited to 'compiler/hsSyn')
-rw-r--r-- | compiler/hsSyn/HsBinds.lhs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/hsSyn/HsBinds.lhs b/compiler/hsSyn/HsBinds.lhs index 0615cbe45e..15fd419271 100644 --- a/compiler/hsSyn/HsBinds.lhs +++ b/compiler/hsSyn/HsBinds.lhs @@ -245,6 +245,13 @@ plusHsValBinds (ValBindsIn ds1 sigs1) (ValBindsIn ds2 sigs2) = ValBindsIn (ds1 `unionBags` ds2) (sigs1 ++ sigs2) plusHsValBinds (ValBindsOut ds1 sigs1) (ValBindsOut ds2 sigs2) = ValBindsOut (ds1 ++ ds2) (sigs1 ++ sigs2) + +getTypeSigNames :: HsValBinds a -> NameSet +-- Get the names that have a user type sig +getTypeSigNames (ValBindsIn {}) + = panic "getTypeSigNames" +getTypeSigNames (ValBindsOut _ sigs) + = mkNameSet [unLoc n | L _ (TypeSig n _) <- sigs] \end{code} What AbsBinds means |