on master help sign in
Check that imports actually exist in the known interfaces
commita56efd851b139c72254fdf396d1a3e9cec03f53f authorEvan Czaplicki <info@elm-lang.org> dateWed 31 Jul 2013, 12:12 (13 years ago) parent4eed8e4
1 file changed+4−1
compiler/Transform/Canonicalize.hs+4−1
compiler/Transform/Canonicalize.hs+4−1
@@ -50,7 +50,10 @@ renameType rename tipe =
5050
5151metadataModule :: Interfaces -> MetadataModule t v -> Either [Doc] (MetadataModule t v)
5252metadataModule ifaces modul =
53− do program' <- rename initialEnv (program modul)
53+ do _ <- case filter (\m -> Map.notMember m ifaces) (map fst realImports) of
54+ [] -> Right ()
55+ missings -> Left [ P.text $ "The following imports were not found: " ++ List.intercalate ", " missings ]
56+ program' <- rename initialEnv (program modul)
5457 aliases' <- mapM (third renameType') (aliases modul)
5558 datatypes' <- mapM (third (mapM (second (mapM renameType')))) (datatypes modul)
5659 return $ modul { program = program', aliases = aliases', datatypes = datatypes' }