Content-Length: 1438 | pFad | http://github.com/purescript/purescript/pull/4380.diff
thub.com diff --git a/src/Language/PureScript/TypeChecker/Types.hs b/src/Language/PureScript/TypeChecker/Types.hs index 59c73e66e8..b230610cc4 100644 --- a/src/Language/PureScript/TypeChecker/Types.hs +++ b/src/Language/PureScript/TypeChecker/Types.hs @@ -369,20 +369,10 @@ infer' (Literal ss (ArrayLiteral vals)) = do return $ TypedValue' True (Literal ss (ArrayLiteral ts')) (srcTypeApp tyArray els) infer' (Literal ss (ObjectLiteral ps)) = do ensureNoDuplicateProperties ps - -- We make a special case for Vars in record labels, since these are the - -- only types of expressions for which 'infer' can return a polymorphic type. - -- They need to be instantiated here. - let shouldInstantiate :: Expr -> Bool - shouldInstantiate Var{} = True - shouldInstantiate (PositionedValue _ _ e) = shouldInstantiate e - shouldInstantiate _ = False - - inferProperty :: (PSString, Expr) -> m (PSString, (Expr, SourceType)) + let inferProperty :: (PSString, Expr) -> m (PSString, (Expr, SourceType)) inferProperty (name, val) = do TypedValue' _ val' ty <- infer val - valAndType <- if shouldInstantiate val - then instantiatePolyTypeWithUnknowns val' ty - else pure (val', ty) + valAndType <- instantiatePolyTypeWithUnknowns val' ty pure (name, valAndType) toRowListItem (lbl, (_, ty)) = srcRowListItem (Label lbl) tyFetched URL: http://github.com/purescript/purescript/pull/4380.diff
Alternative Proxies: