git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1654 from purescript/1636

Fix #1636, instantiate polytypes fully, even under constraints.

commitf36f1d5885900182db49ef3e9c56611c2c2d4bb9 authorPhil Freeman <paf31@cantab.net> dateSat 21 Nov 2015, 14:56 (11 years ago) parentdee7ee7c2f0d1f
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