git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #1534 again
commit2afa7b126a1892ea5e0e52e95b8885faf7f89d26 authorPhil Freeman <paf31@cantab.net> dateSun 25 Oct 2015, 17:42 (11 years ago) parent35afca6
1 file changed+5−5
src/Language/PureScript/TypeChecker/Types.hs+5−5
src/Language/PureScript/TypeChecker/Types.hs+5−5
@@ -79,7 +79,7 @@ typesOf moduleName vals = do
7979 tys <- fmap tidyUp . liftUnifyWarnings replace $ do
8080 (untyped, typed, dict, untypedDict) <- typeDictionaryForBindingGroup moduleName vals
8181 ds1 <- parU typed $ \e -> checkTypedBindingGroupElement moduleName e dict
82− ds2 <- forM untyped $ \e -> typeForBindingGroupElement e dict untypedDict
82+ ds2 <- forM untyped $ \e -> typeForBindingGroupElement True e dict untypedDict
8383 return $ ds1 ++ ds2
8484
8585 forM tys $ \(ident, (val, ty)) -> do
@@ -137,12 +137,12 @@ checkTypedBindingGroupElement mn (ident, (val', ty, checkType)) dict = do
137137 else return (TypedValue False val' ty'')
138138 return (ident, (val'', ty''))
139139
140−typeForBindingGroupElement :: (Ident, Expr) -> TypeData -> UntypedData -> UnifyT Type Check (Ident, (Expr, Type))
141−typeForBindingGroupElement (ident, val) dict untypedDict = do
140+typeForBindingGroupElement :: Bool -> (Ident, Expr) -> TypeData -> UntypedData -> UnifyT Type Check (Ident, (Expr, Type))
141+typeForBindingGroupElement warn (ident, val) dict untypedDict = do
142142 -- Infer the type with the new names in scope
143143 TypedValue _ val' ty <- bindNames dict $ infer val
144144 ty =?= fromMaybe (internalError "name not found in dictionary") (lookup ident untypedDict)
145− tell . errorMessage $ MissingTypeDeclaration ident ty
145+ when warn . tell . errorMessage $ MissingTypeDeclaration ident ty
146146 return (ident, (TypedValue True val' ty, ty))
147147
148148-- |
@@ -311,7 +311,7 @@ inferLetBinding seen (BindingGroupDeclaration ds : rest) ret j = do
311311 Just moduleName <- checkCurrentModule <$> get
312312 (untyped, typed, dict, untypedDict) <- typeDictionaryForBindingGroup moduleName (map (\(i, _, v) -> (i, v)) ds)
313313 ds1' <- parU typed $ \e -> checkTypedBindingGroupElement moduleName e dict
314− ds2' <- forM untyped $ \e -> typeForBindingGroupElement e dict untypedDict
314+ ds2' <- forM untyped $ \e -> typeForBindingGroupElement False e dict untypedDict
315315 let ds' = [(ident, Private, val') | (ident, (val', _)) <- ds1' ++ ds2']
316316 bindNames dict $ do
317317 makeBindingGroupVisible