@@ -19,6 +19,7 @@ data Error
19 | TypeWithoutDefinition String
19 | TypeWithoutDefinition String
20 | PortWithoutAnnotation String
20 | PortWithoutAnnotation String
21 | UnexpectedPort
21 | UnexpectedPort
22+ | DuplicateArgument String String
22 | DuplicateFieldName String
23 | DuplicateFieldName String
23 | DuplicateValueDeclaration String
24 | DuplicateValueDeclaration String
24 | DuplicateTypeDeclaration String
25 | DuplicateTypeDeclaration String
@@ -27,7 +28,6 @@ data Error
27 | UnboundTypeVarsInAlias String [String] [String]
28 | UnboundTypeVarsInAlias String [String] [String]
28 | UnusedTypeVarsInAlias String [String] [String]
29 | UnusedTypeVarsInAlias String [String] [String]
29 | MessyTypeVarsInAlias String [String] [String] [String]
30 | MessyTypeVarsInAlias String [String] [String] [String]
30− | RepeatedArgument String
33-- TO REPORT
33-- TO REPORT
@@ -110,6 +110,20 @@ toReport _localizer err =
110 \ if the module is imported twice, do we send values out the port twice?"
110 \ if the module is imported twice, do we send values out the port twice?"
113+ DuplicateArgument funcName argName ->
115+ "DUPLICATE ARGUMENT"
117+ ( "The name `" ++ argName
118+ ++ "` is used more than once in the arguments of `"
121+ ( Help.reflowParagraph $
122+ "Rename things until `" ++ argName ++ "` is used only once.\
123+ \ Otherwise how can we tell which one you want when you\
124+ \ say `" ++ argName ++ "` it in the body of your function?"
113 DuplicateFieldName name ->
127 DuplicateFieldName name ->
114 Report.report
128 Report.report
115 "DUPLICATE FIELD"
129 "DUPLICATE FIELD"
@@ -190,17 +204,6 @@ toReport _localizer err =
193− RepeatedArgument name ->
195− "FUNCTION ARGUMENT REPEATED"
197− ( "The argument `" ++ name ++ "` is defined multiple times."
199− ( Help.reflowParagraph $
200− "You should rename one of the occurrences of `" ++ name
201− ++ "` so that each argument is defined only once."
205unboundTypeVars :: String -> String -> [String] -> [String] -> Report.Report
208unboundTypeVars :: String -> String -> [String] -> [String] -> Report.Report
206unboundTypeVars declKind typeName givenVars unboundVars@(tvar:_) =
209unboundTypeVars declKind typeName givenVars unboundVars@(tvar:_) =