git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #1636, instantiate polytypes fully, even under constraints.
commitc2f0d1fa6e904635760dadd338548fbd97245293 authorPhil Freeman <paf31@cantab.net> dateSat 21 Nov 2015, 14:10 (11 years ago) parent2627e5a
1 file changed+1−2
src/Language/PureScript/TypeChecker/Types.hs+1−2
src/Language/PureScript/TypeChecker/Types.hs+1−2
@@ -213,8 +213,7 @@ instantiatePolyTypeWithUnknowns val (ForAll ident ty _) = do
213213 instantiatePolyTypeWithUnknowns val ty'
214214instantiatePolyTypeWithUnknowns val (ConstrainedType constraints ty) = do
215215 dicts <- getTypeClassDictionaries
216− (_, ty') <- instantiatePolyTypeWithUnknowns (internalError "Types under a constraint cannot themselves be constrained") ty
217− return (foldl App val (map (flip TypeClassDictionary dicts) constraints), ty')
216+ instantiatePolyTypeWithUnknowns (foldl App val (map (flip TypeClassDictionary dicts) constraints)) ty
218217instantiatePolyTypeWithUnknowns val ty = return (val, ty)
219218
220219-- | Infer a type for a value, rethrowing any error to provide a more useful error message