@@ -8,6 +8,7 @@ import Text.PrettyPrint.ANSI.Leijen (dullyellow, hsep, text)
9import qualified Reporting.Error.Helpers as Help
9import qualified Reporting.Error.Helpers as Help
10import qualified Reporting.Render.Type as RenderType
10import qualified Reporting.Render.Type as RenderType
11+import qualified Reporting.Region as Region
11import qualified Reporting.Report as Report
12import qualified Reporting.Report as Report
@@ -29,7 +30,7 @@ data Error
29 | TypeWithoutDefinition String
30 | TypeWithoutDefinition String
31 | DuplicateArgument String String
32 | DuplicateArgument String String
32− | DuplicateFieldName String
33+ | DuplicateFieldName Region.Region String
33 | DuplicateValueDeclaration String
34 | DuplicateValueDeclaration String
34 | DuplicateTypeDeclaration String
35 | DuplicateTypeDeclaration String
35 | DuplicateDefinition String
36 | DuplicateDefinition String
@@ -188,10 +189,10 @@ toReport _localizer err =
188 \ say `" ++ argName ++ "` it in the body of your function?"
189 \ say `" ++ argName ++ "` it in the body of your function?"
191− DuplicateFieldName name ->
192+ DuplicateFieldName region name ->
192 Report.report
193 Report.report
193 "DUPLICATE FIELD"
194 "DUPLICATE FIELD"
194− Nothing
195+ (Just region)
195 ("This record has more than one field named `" ++ name ++ "`.")
196 ("This record has more than one field named `" ++ name ++ "`.")
196 (text "There can only be one. Do some renaming to make sure the names are distinct!")
197 (text "There can only be one. Do some renaming to make sure the names are distinct!")