diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2018-09-20 19:53:56 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2018-09-23 02:45:23 +0100 |
commit | cad5d0b69bc039b635a6eb0e5c9ed47d7c5a38ed (patch) | |
tree | e245f11c6cb56e4422a9e0875ceacd93c3ef4096 /compiler/hsSyn | |
parent | 7e77f41430ae1cad84d5b0c90328331d38f3eda0 (diff) | |
download | haskell-cad5d0b69bc039b635a6eb0e5c9ed47d7c5a38ed.tar.gz |
Buglet in reporting out of scope errors in rules
Most out of scope errors get reported by the type checker these
days, but not all. Example, the function on the LHS of a RULE.
Trace #15659 pointed out that this less-heavily-used code path
produce a "wacky" error message. Indeed so. Easily fixed.
Diffstat (limited to 'compiler/hsSyn')
-rw-r--r-- | compiler/hsSyn/HsExpr.hs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index 6ca37e07ce..61285ba0c6 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -179,8 +179,15 @@ is Less Cool because typecheck do-notation with (>>=) :: m1 a -> (a -> m2 b) -> m2 b.) -} --- | An unbound variable; used for treating out-of-scope variables as --- expression holes +-- | An unbound variable; used for treating +-- out-of-scope variables as expression holes +-- +-- Either "x", "y" Plain OutOfScope +-- or "_", "_x" A TrueExprHole +-- +-- Both forms indicate an out-of-scope variable, but the latter +-- indicates that the user /expects/ it to be out of scope, and +-- just wants GHC to report its type data UnboundVar = OutOfScope OccName GlobalRdrEnv -- ^ An (unqualified) out-of-scope -- variable, together with the GlobalRdrEnv |