git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix a typechecker bug which caused type class dictionaries to not be inserted in a particular case
commite3846109560f305fa4bc386c11215da0e71517df authorPhil Freeman <paf31@cantab.net> dateWed 12 Feb 2014, 16:44 (13 years ago) parent8da3088
2 files changed+11−3
examples/passing/InferRecFunWithConstrainedArgument.purs+8 src/Language/PureScript/TypeChecker/Types.hs+3−3
examples/passing/InferRecFunWithConstrainedArgument.pursnew file+8
@@ -0,0 +1,8 @@
1+module Main where
2+
3+import Prelude
4+
5+test 100 = 100
6+test n = test(1 + n)
7+
8+main = Trace.print $ test 0
src/Language/PureScript/TypeChecker/Types.hs+3−3
@@ -949,9 +949,9 @@ checkFunctionApplication' fn (ForAll ident ty _) arg = do
949949 checkFunctionApplication fn replaced arg
950950checkFunctionApplication' fn u@(TUnknown _) arg = do
951951 arg' <- do
952− TypedValue _ v t <- infer arg
953− (v', t') <- instantiatePolyTypeWithUnknowns arg t
954− return $ TypedValue True v' t'
952+ TypedValue _ arg' t <- infer arg
953+ (arg'', t') <- instantiatePolyTypeWithUnknowns arg' t
954+ return $ TypedValue True arg'' t'
955955 let ty = (\(TypedValue _ _ t) -> t) arg'
956956 ret <- fresh
957957 u =?= function ty ret