@@ -68,7 +68,7 @@ data Error
68 | PortPayloadInvalid A.Region Name.Name Can.Type InvalidPayload
68 | PortPayloadInvalid A.Region Name.Name Can.Type InvalidPayload
69 | PortTypeInvalid A.Region Name.Name PortProblem
69 | PortTypeInvalid A.Region Name.Name PortProblem
70 | RecursiveAlias A.Region Name.Name [Name.Name] Src.Type [Name.Name]
70 | RecursiveAlias A.Region Name.Name [Name.Name] Src.Type [Name.Name]
71− | RecursiveDecl [Can.Def]
71+ | RecursiveDecl A.Region Name.Name [Name.Name]
72 | RecursiveLet (A.Located Name.Name) [Name.Name]
72 | RecursiveLet (A.Located Name.Name) [Name.Name]
73 | Shadowing Name.Name A.Region A.Region
73 | Shadowing Name.Name A.Region A.Region
74 | TupleLargerThanThree A.Region
74 | TupleLargerThanThree A.Region
@@ -668,64 +668,51 @@ toReport source err =
668 RecursiveAlias region name args tipe others ->
668 RecursiveAlias region name args tipe others ->
669 aliasRecursionReport source region name args tipe others
669 aliasRecursionReport source region name args tipe others
671− RecursiveDecl cyclicValueDefs ->
671+ RecursiveDecl region name names ->
675− Can.Def name _ _ -> name
676− Can.TypedDef name _ _ _ _ -> name
678 makeTheory question details =
673 makeTheory question details =
679 D.fillSep $ map (D.dullyellow . D.fromChars) (words question) ++ map D.fromChars (words details)
674 D.fillSep $ map (D.dullyellow . D.fromChars) (words question) ++ map D.fromChars (words details)
681− case map toName cyclicValueDefs of
684− "There is some compiler bug in reporting cyclic definitions.\n\
685− \Please get a <http://sscce.org/> and share the details at\n\
686− \<https://github.com/elm/compiler/issues>"
688− A.At region name : otherNames ->
689− Report.Report "CYCLIC DEFINITION" region [] $
676+ Report.Report "CYCLIC DEFINITION" region [] $
690− Report.toCodeSnippet source region Nothing $
677+ Report.toCodeSnippet source region Nothing $
691− case map A.toValue otherNames of
678+ case names of
694− D.reflow $
681+ D.reflow $
695− "The `" <> Name.toChars name <> "` value is defined directly in terms of itself, causing an infinite loop."
682+ "The `" <> Name.toChars name <> "` value is defined directly in terms of itself, causing an infinite loop."
698− [ makeTheory "Are you are trying to mutate a variable?" $
685+ [ makeTheory "Are you are trying to mutate a variable?" $
699− "Elm does not have mutation, so when I see " ++ Name.toChars name
686+ "Elm does not have mutation, so when I see " ++ Name.toChars name
700− ++ " defined in terms of " ++ Name.toChars name
687+ ++ " defined in terms of " ++ Name.toChars name
701− ++ ", I treat it as a recursive definition. Try giving the new value a new name!"
688+ ++ ", I treat it as a recursive definition. Try giving the new value a new name!"
702− , makeTheory "Maybe you DO want a recursive value?" $
689+ , makeTheory "Maybe you DO want a recursive value?" $
703− "To define " ++ Name.toChars name ++ " we need to know what " ++ Name.toChars name
690+ "To define " ++ Name.toChars name ++ " we need to know what " ++ Name.toChars name
704− ++ " is, so let’s expand it. Wait, but now we need to know what " ++ Name.toChars name
691+ ++ " is, so let’s expand it. Wait, but now we need to know what " ++ Name.toChars name
705− ++ " is, so let’s expand it... This will keep going infinitely!"
692+ ++ " is, so let’s expand it... This will keep going infinitely!"
706− , D.link "Hint"
693+ , D.link "Hint"
707− "The root problem is often a typo in some variable name, but I recommend reading"
694+ "The root problem is often a typo in some variable name, but I recommend reading"
708− "bad-recursion"
695+ "bad-recursion"
709− "for more detailed advice, especially if you actually do need a recursive value."
696+ "for more detailed advice, especially if you actually do need a recursive value."
715− D.reflow $
702+ D.reflow $
716− "The `" <> Name.toChars name <> "` definition is causing a very tricky infinite loop."
703+ "The `" <> Name.toChars name <> "` definition is causing a very tricky infinite loop."
719− [ D.reflow $
706+ [ D.reflow $
720− "The `" <> Name.toChars name
707+ "The `" <> Name.toChars name
721− <> "` value depends on itself through the following chain of definitions:"
708+ <> "` value depends on itself through the following chain of definitions:"
722− , D.cycle 4 (name:names)
709+ , D.cycle 4 name names
723− , D.link "Hint"
710+ , D.link "Hint"
724− "The root problem is often a typo in some variable name, but I recommend reading"
711+ "The root problem is often a typo in some variable name, but I recommend reading"
725− "bad-recursion"
712+ "bad-recursion"
726− "for more detailed advice, especially if you actually do want mutually recursive values."
713+ "for more detailed advice, especially if you actually do want mutually recursive values."
730 RecursiveLet (A.At region name) names ->
717 RecursiveLet (A.At region name) names ->
731 Report.Report "CYCLIC VALUE" region [] $
718 Report.Report "CYCLIC VALUE" region [] $
@@ -765,7 +752,7 @@ toReport source err =
765 [ D.reflow $
752 [ D.reflow $
766 "The `" <> Name.toChars name
753 "The `" <> Name.toChars name
767 <> "` value depends on itself through the following chain of definitions:"
754 <> "` value depends on itself through the following chain of definitions:"
768− , D.cycle 4 (name:names)
755+ , D.cycle 4 name names
769 , D.link "Hint"
756 , D.link "Hint"
770 "The root problem is often a typo in some variable name, but I recommend reading"
757 "The root problem is often a typo in some variable name, but I recommend reading"
771 "bad-recursion"
758 "bad-recursion"
@@ -1252,7 +1239,7 @@ aliasRecursionReport source region name args tipe others =
1254 [ "It is part of this cycle of type aliases:"
1241 [ "It is part of this cycle of type aliases:"
1255− , D.cycle 4 (name:others)
1242+ , D.cycle 4 name others
1256 , D.reflow $
1243 , D.reflow $
1257 "You need to convert at least one of these type aliases into a `type`."
1244 "You need to convert at least one of these type aliases into a `type`."
1258 , D.link "Note" "Read" "recursive-alias"
1245 , D.link "Note" "Read" "recursive-alias"