diff options
author | simonmar <unknown> | 2000-06-09 15:15:25 +0000 |
---|---|---|
committer | simonmar <unknown> | 2000-06-09 15:15:25 +0000 |
commit | 45a3e562564889cf52d65dbe2b98bb426aa305fe (patch) | |
tree | fb6e9523a2c7e6f5eb8ab1ed8c6375e939d1f431 | |
parent | eb89bddabdcbae2a59474fc9538fa88b9f20230d (diff) | |
download | haskell-45a3e562564889cf52d65dbe2b98bb426aa305fe.tar.gz |
[project @ 2000-06-09 15:15:25 by simonmar]
Don't group variable bindings with the same name together. They
should be flagged as duplicate definitions.
-rw-r--r-- | ghc/compiler/parser/ParseUtil.lhs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ghc/compiler/parser/ParseUtil.lhs b/ghc/compiler/parser/ParseUtil.lhs index 3e7cafe184..430460aa24 100644 --- a/ghc/compiler/parser/ParseUtil.lhs +++ b/ghc/compiler/parser/ParseUtil.lhs @@ -391,8 +391,15 @@ groupBindings binds = group Nothing binds where group :: Maybe RdrNameMonoBinds -> [RdrBinding] -> RdrBinding group (Just bind) [] = RdrValBinding bind group Nothing [] = RdrNullBind + + -- don't group together FunMonoBinds if they have + -- no arguments. This is necessary now that variable bindings + -- with no arguments are now treated as FunMonoBinds rather + -- than pattern bindings (tests/rename/should_fail/rnfail002). group (Just (FunMonoBind f inf1 mtchs ignore_srcloc)) - (RdrValBinding (FunMonoBind f' _ [mtch] loc) : binds) + (RdrValBinding (FunMonoBind f' _ + [mtch@(Match _ (_:_) _ _)] loc) + : binds) | f == f' = group (Just (FunMonoBind f inf1 (mtch:mtchs) loc)) binds group (Just so_far) binds |