git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #332
commit621ea3067d0d733bb65724669961e9c5fdacfe1a authorPhil Freeman <paf31@cantab.net> dateFri 28 Mar 2014, 19:05 (13 years ago) parent09d0ecd
2 files changed+5−1
examples/failing/Let.purs+3 src/Language/PureScript/TypeChecker/Types.hs+2−1
examples/failing/Let.pursnew file+3
@@ -0,0 +1,3 @@
1+module Main where
2+
3+test = let x = x in x
src/Language/PureScript/TypeChecker/Types.hs+2−1
@@ -585,7 +585,8 @@ inferLetBinding seen [] ret j = (,) seen <$> j ret
585585inferLetBinding seen (ValueDeclaration ident nameKind [] Nothing val : rest) ret j = do
586586 valTy <- fresh
587587 Just moduleName <- checkCurrentModule <$> get
588− TypedValue _ val' valTy' <- bindNames (M.singleton (moduleName, ident) (valTy, nameKind)) $ infer val
588+ let dict = if isFunction val then M.singleton (moduleName, ident) (valTy, nameKind) else M.empty
589+ TypedValue _ val' valTy' <- bindNames dict $ infer val
589590 valTy =?= valTy'
590591 bindNames (M.singleton (moduleName, ident) (valTy', nameKind)) $ inferLetBinding (seen ++ [ValueDeclaration ident nameKind [] Nothing val']) rest ret j
591592inferLetBinding seen (BindingGroupDeclaration ds : rest) ret j = do