Skip to content
Snippets Groups Projects
Commit e12e1956 authored by Simon Marlow's avatar Simon Marlow
Browse files

[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.
parent 85bd53c9
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment