on master help sign in
Turn on warning for undefined values.
commit8ae1d112dc4b9e01aeb3d87f29db167f6dc497c0 authorevancz <info@elm-lang.org> dateTue 28 May 2013, 06:48 (13 years ago) parent3a36946
1 file changed+5−2
compiler/Types/Constrain.hs+5−2
compiler/Types/Constrain.hs+5−2
@@ -16,6 +16,8 @@ import Guid
1616import Types.Types
1717import qualified Types.Substitutions as Subs
1818
19+import System.IO.Unsafe
20+
1921beta = VarT `liftM` guid
2022unionA = Map.unionWith (++)
2123unionsA = Map.unionsWith (++)
@@ -73,8 +75,9 @@ constrain typeHints (Module _ _ imports stmts) = do
7375 cs = concat . Map.elems $ Map.intersectionWithKey f allHints assumptions
7476 escapees = Map.keys $ Map.difference assumptions allHints
7577 return $ case escapees of
76− _ -> Right (Set.toList constraints ++ cs)
77− --_ -> Left ("Undefined variable(s): " ++ intercalate ", " escapees)
78+ [] -> Right (Set.toList constraints ++ cs)
79+ _ -> unsafePerformIO (print escapees) `seq` Right (Set.toList constraints ++ cs)
80+ _ -> Left ("Undefined variable(s): " ++ intercalate ", " escapees)
7881
7982type TVarMap = Map.Map String [X]
8083type ConstraintSet = Set.Set (Context Constraint)