[project @ 2000-03-27 13:23:49 by simonpj]
Improve the error messages given when a definition isn't polymorphic enough. In paticular, for this program: let v = runST (newSTRef True) in runST (readSTRef v) we get the message Inferred type is less polymorphic than expected Quantified type variable `s' escapes It is reachable from the type variable(s) `a' which are free in the signature Signature type: forall s. ST s a Type to generalise: ST s (STRef s Bool) When checking an expression type signature In the first argument of `runST', namely `(newSTRef True)' In the right-hand side of a pattern binding: runST (newSTRef True)
Showing
- ghc/compiler/typecheck/TcBinds.lhs 5 additions, 6 deletionsghc/compiler/typecheck/TcBinds.lhs
- ghc/compiler/typecheck/TcClassDcl.lhs 4 additions, 5 deletionsghc/compiler/typecheck/TcClassDcl.lhs
- ghc/compiler/typecheck/TcExpr.lhs 5 additions, 5 deletionsghc/compiler/typecheck/TcExpr.lhs
- ghc/compiler/typecheck/TcMatches.lhs 3 additions, 3 deletionsghc/compiler/typecheck/TcMatches.lhs
- ghc/compiler/typecheck/TcMonoType.lhs 68 additions, 35 deletionsghc/compiler/typecheck/TcMonoType.lhs
- ghc/compiler/typecheck/TcRules.lhs 1 addition, 1 deletionghc/compiler/typecheck/TcRules.lhs
- ghc/compiler/typecheck/TcSimplify.lhs 1 addition, 2 deletionsghc/compiler/typecheck/TcSimplify.lhs
Loading
Please register or sign in to comment