on master help sign in
Show type errors in the order they appear in the source file
commitda346ea6a1aca9394141370e8cfebf32d114bc01 authorEvan Czaplicki <info@elm-lang.org> dateSat 27 Jul 2013, 00:53 (13 years ago) parent5234d6d
1 file changed+2−4
compiler/Type/Inference.hs+2−4
compiler/Type/Inference.hs+2−4
@@ -27,8 +27,6 @@ infer interfaces' modul = unsafePerformIO $ do
2727 localImports = foldr insert Map.empty (imports modul)
2828 interfaces = Map.intersectionWithKey Module.canonicalize localImports interfaces'
2929
30−-- mapM print (concatMap iAdts (Map.elems interfaces))
31−
3230 env <- Env.initialEnvironment
3331 (datatypes modul ++ concatMap iAdts (Map.elems interfaces))
3432 (aliases modul ++ concatMap iAliases (Map.elems interfaces))
@@ -36,7 +34,7 @@ infer interfaces' modul = unsafePerformIO $ do
3634 do (_, vars, args, result) <- Env.freshDataScheme env name
3735 return (name, (vars, foldr (T.==>) result args))
3836
39−-- mapM print (map Map.toList $ Map.elems locals)
37+-- mapM print . Map.toList $ Env.aliases env
4038-- mapM print (imports modul)
4139
4240 importedVars <-
@@ -56,5 +54,5 @@ infer interfaces' modul = unsafePerformIO $ do
5654 let errors = TS.sErrors state
5755 if null errors
5856 then return $ Right (Map.difference (TS.sSavedEnv state) header)
59− else Left `fmap` sequence errors
57+ else Left `fmap` sequence (reverse errors)
6058