on master help sign in
Stop threading type localizer through canonicalization error code
99ef42eEvan Czaplicki
src/Reporting/Error/Canonicalize.hs+6−7
@@ -25,7 +25,6 @@ import qualified Elm.Name as N
25import qualified Reporting.Annotation as A
25import qualified Reporting.Annotation as A
26import qualified Reporting.Region as R
26import qualified Reporting.Region as R
27import qualified Reporting.Render.Code as Code
27import qualified Reporting.Render.Code as Code
28−import qualified Reporting.Render.Type as Type
29import qualified Reporting.Report as Report
28import qualified Reporting.Report as Report
30import qualified Reporting.Helpers as H
29import qualified Reporting.Helpers as H
31import Reporting.Helpers ( Doc, (<>) )
30import Reporting.Helpers ( Doc, (<>) )
@@ -142,8 +141,8 @@ toKindInfo kind name =
142-- TO REPORT
141-- TO REPORT
143
142
144
143
145−toReport :: Code.Source -> Type.Localizer -> Error -> Report.Report
144+toReport :: Code.Source -> Error -> Report.Report
146−toReport source localizer err =
145+toReport source err =
147 case err of
146 case err of
148 AnnotationTooShort region name index leftovers ->
147 AnnotationTooShort region name index leftovers ->
149 let
148 let
@@ -630,7 +629,7 @@ toReport source localizer err =
630 )
629 )
631
630
632 RecursiveAlias region name args tipe others ->
631 RecursiveAlias region name args tipe others ->
633− aliasRecursionReport source localizer region name args tipe others
632+ aliasRecursionReport source region name args tipe others
634
633
635 RecursiveDecl cyclicValueDefs ->
634 RecursiveDecl cyclicValueDefs ->
636 error "TODO" cyclicValueDefs
635 error "TODO" cyclicValueDefs
@@ -1016,8 +1015,8 @@ _argMismatchReport source region kind name expected actual =
1016-- BAD ALIAS RECURSION
1015-- BAD ALIAS RECURSION
1017
1016
1018
1017
1019−aliasRecursionReport :: Code.Source -> Type.Localizer -> R.Region -> N.Name -> [N.Name] -> Src.Type -> [N.Name] -> Report.Report
1018+aliasRecursionReport :: Code.Source -> R.Region -> N.Name -> [N.Name] -> Src.Type -> [N.Name] -> Report.Report
1020−aliasRecursionReport source localizer region name args tipe others =
1019+aliasRecursionReport source region name args tipe others =
1021 case others of
1020 case others of
1022 [] ->
1021 [] ->
1023 Report.Report "ALIAS PROBLEM" region [] $
1022 Report.Report "ALIAS PROBLEM" region [] $
@@ -1030,7 +1029,7 @@ aliasRecursionReport source localizer region name args tipe others =
1030 "When I expand a recursive type alias, it just keeps getting bigger and bigger.\
1029 "When I expand a recursive type alias, it just keeps getting bigger and bigger.\
1031 \ So dealiasing results in an infinitely large type! Try this instead:"
1030 \ So dealiasing results in an infinitely large type! Try this instead:"
1032 , H.indent 4 $
1031 , H.indent 4 $
1033− Type.decl localizer name args [(name, [error "TODO" tipe])]
1032+ error "TODO alias to doc" name args tipe
1034 , H.link "Hint"
1033 , H.link "Hint"
1035 "This is kind of a subtle distinction. I suggested the naive fix, but I recommend reading"
1034 "This is kind of a subtle distinction. I suggested the naive fix, but I recommend reading"
1036 "recursive-alias"
1035 "recursive-alias"