git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1525 from purescript/remove-type-export-check
d684fccGary Burgess
src/Language/PureScript/TypeChecker.hs−12
@@ -273,7 +273,6 @@ typeCheckModule (Module ss coms mn decls (Just exps)) = warnAndRethrow (addHint
273 modify (\s -> s { checkCurrentModule = Just mn })
273 modify (\s -> s { checkCurrentModule = Just mn })
274 decls' <- typeCheckAll mn exps decls
274 decls' <- typeCheckAll mn exps decls
275 forM_ exps $ \e -> do
275 forM_ exps $ \e -> do
276− checkTypesAreExported e
277 checkClassMembersAreExported e
276 checkClassMembersAreExported e
278 checkClassesAreExported e
277 checkClassesAreExported e
279 return $ Module ss coms mn decls' (Just exps)
278 return $ Module ss coms mn decls' (Just exps)
@@ -295,17 +294,6 @@ typeCheckModule (Module ss coms mn decls (Just exps)) = warnAndRethrow (addHint
295 exports _ _ = False
294 exports _ _ = False
296 checkMemberExport _ _ = return ()
295 checkMemberExport _ _ = return ()
297
296
298− -- Check that all the type constructors defined in the current module that appear in member types
299− -- have also been exported from the module
300− checkTypesAreExported :: DeclarationRef -> Check ()
301− checkTypesAreExported = checkMemberExport findTcons
302− where
303− findTcons :: Type -> [DeclarationRef]
304− findTcons = everythingOnTypes (++) go
305− where
306− go (TypeConstructor (Qualified (Just mn') name)) | mn' == mn = [TypeRef name (error "Data constructors unused in checkTypesAreExported")]
307− go _ = []
308−
309 -- Check that all the classes defined in the current module that appear in member types have also
297 -- Check that all the classes defined in the current module that appear in member types have also
310 -- been exported from the module
298 -- been exported from the module
311 checkClassesAreExported :: DeclarationRef -> Check ()
299 checkClassesAreExported :: DeclarationRef -> Check ()