on master help sign in
Use friendlier term "Name Collision" and clearer message
39f4127Evan Czaplicki
src/Transform/Check.hs+5−3
@@ -45,7 +45,7 @@ duplicateValues decls =
45
45
46 where
46 where
47 msg x =
47 msg x =
48− "Naming Error: There can only be one definition of '" ++ x ++ "'."
48+ "Name Collision: There can only be one definition of '" ++ x ++ "'."
49
49
50 (defPatterns, defExprs) =
50 (defPatterns, defExprs) =
51 unzip [ (pat,expr) | D.Definition (Valid.Definition pat expr _) <- decls ]
51 unzip [ (pat,expr) | D.Definition (Valid.Definition pat expr _) <- decls ]
@@ -85,12 +85,14 @@ duplicateTypeDeclarations decls =
85
85
86dupTypeError :: String -> String
86dupTypeError :: String -> String
87dupTypeError name =
87dupTypeError name =
88− "Naming Error: There can only be one type named '" ++ name ++ "'"
88+ "Name Collision: There can only be one type named '" ++ name ++ "'"
89
89
90
90
91dupCtorError :: String -> String
91dupCtorError :: String -> String
92dupCtorError name =
92dupCtorError name =
93− "Naming Error: There can only be one type or record constructor named '" ++ name ++ "'"
93+ "Name Collision: There can only be one constructor named '" ++ name ++ "'.\n"
94+ ++ " Constructors are created for record type aliases and for union types, so\n"
95+ ++ " something should be renamed or moved to a different module."
94
96
95
97
96illFormedTypes :: [D.ValidDecl] -> [Doc]
98illFormedTypes :: [D.ValidDecl] -> [Doc]