@@ -675,6 +675,11 @@ infer' _ = error "Invalid argument to infer"
675675
676676inferLetBinding :: [Declaration] -> [Declaration] -> Value -> (Value -> UnifyT Type Check Value) -> UnifyT Type Check ([Declaration], Value)
677677inferLetBinding seen [] ret j = (,) seen <$> j ret
678+inferLetBinding seen (ValueDeclaration ident nameKind [] Nothing tv@(TypedValue checkType val ty) : rest) ret j = do
679+ Just moduleName <- checkCurrentModule <$> get
680+ let dict = if isFunction val then M.singleton (moduleName, ident) (ty, nameKind) else M.empty
681+ TypedValue _ val' ty' <- if checkType then bindNames dict (check val ty) else return tv
682+ bindNames (M.singleton (moduleName, ident) (ty', nameKind)) $ inferLetBinding (seen ++ [ValueDeclaration ident nameKind [] Nothing (TypedValue checkType val' ty')]) rest ret j
678683inferLetBinding seen (ValueDeclaration ident nameKind [] Nothing val : rest) ret j = do
679684 valTy <- fresh
680685 Just moduleName <- checkCurrentModule <$> get
@@ -1103,3 +1108,4 @@ subsumes' val ty1 ty2 = do
11031108
11041109
11051110
1111+