on master help sign in
Trim out some code in TopLevelTypes

If we made it past type inference, every declared name must appear in the type environment.

commit5af390dfdffa5251e3da76aed085d6a2a726c180 authorEvan Czaplicki <info@elm-lang.org> dateThu 3 Mar 2016, 10:09 (11 years ago) parent9172af8
1 file changed+3−6
src/Nitpick/TopLevelTypes.hs+3−6
src/Nitpick/TopLevelTypes.hs+3−6
@@ -1,6 +1,7 @@
11{-# OPTIONS_GHC -Wall #-}
22module Nitpick.TopLevelTypes (topLevelTypes) where
33
4+import Data.Map ((!))
45import Prelude hiding (maybe)
56import qualified Data.Foldable as F
67import qualified Data.Map as Map
@@ -39,14 +40,10 @@ warnMissingAnnotation
3940warnMissingAnnotation typeEnv (A.A (region,_) decl) =
4041 case decl of
4142 Decl.Def (Valid.Definition (A.A _ (P.Var name)) _ Nothing) ->
42− case Map.lookup name typeEnv of
43− Nothing ->
44− return ()
43+ Result.warn region (Warning.MissingTypeAnnotation name (typeEnv ! name))
4544
46− Just tipe ->
47− Result.warn region (Warning.MissingTypeAnnotation name tipe)
4845 _ ->
49− return ()
46+ return ()
5047
5148
5249