diff options
author | simonm <unknown> | 1997-12-04 11:02:12 +0000 |
---|---|---|
committer | simonm <unknown> | 1997-12-04 11:02:12 +0000 |
commit | e12e19567024ade8643918a88cc22a74d879afdb (patch) | |
tree | 1ead435a3b2d1f88bf0fcb4a29ab0d9e3db9ff86 /ghc/compiler/reader/RdrHsSyn.lhs | |
parent | 85bd53c951e5504005b9bf9dc3dd884099942f37 (diff) | |
download | haskell-e12e19567024ade8643918a88cc22a74d879afdb.tar.gz |
[project @ 1997-12-04 11:02:12 by simonm]
fix huge bug in extractHsTyVars - the list returned wasn't always a
set (i.e. it could have duplicates). This screwed up support for
universal quantification in a couple of places.
Diffstat (limited to 'ghc/compiler/reader/RdrHsSyn.lhs')
-rw-r--r-- | ghc/compiler/reader/RdrHsSyn.lhs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ghc/compiler/reader/RdrHsSyn.lhs b/ghc/compiler/reader/RdrHsSyn.lhs index 053915204f..22827fa4e1 100644 --- a/ghc/compiler/reader/RdrHsSyn.lhs +++ b/ghc/compiler/reader/RdrHsSyn.lhs @@ -127,16 +127,16 @@ extractHsTyVars ty -- In (All a => a -> a) -> Int, there are no free tyvars -- We just assume that we quantify over all type variables mentioned in the context. - get (HsPreForAllTy ctxt ty) acc = filter (`notElem` locals) (get ty []) - ++ acc - where - locals = foldr (get . snd) [] ctxt + get (HsPreForAllTy ctxt ty) acc = + foldr insert acc (filter (`notElem` locals) (get ty [])) + where + locals = foldr (get . snd) [] ctxt - get (HsForAllTy tvs ctxt ty) acc = (filter (`notElem` locals) $ + get (HsForAllTy tvs ctxt ty) acc = + foldr insert acc (filter (`notElem` locals) $ foldr (get . snd) (get ty []) ctxt) - ++ acc - where - locals = map getTyVarName tvs + where + locals = map getTyVarName tvs insert (Qual _ _ _) acc = acc insert (Unqual (TCOcc _)) acc = acc |