@@ -987,20 +987,21 @@ ambiguousName source region maybePrefix name possibleHomes thing =
987 Nothing ->
987 Nothing ->
989 homeToYellowDoc (ModuleName.Canonical _ home) =
989 homeToYellowDoc (ModuleName.Canonical _ home) =
990− D.dullyellow (D.fromName home)
990+ D.dullyellow (D.fromName home <> "." <> D.fromName name)
993− if length possibleHomes == 2 then "both" else "all"
996− D.reflow $ "This usage of `" ++ Name.toChars name ++ "` is ambiguous."
993+ D.reflow $ "This usage of `" ++ Name.toChars name ++ "` is ambiguous:"
999 [ D.reflow $
996 [ D.reflow $
1000− "Check your imports. The following modules " ++ bothOrAll
997+ "This name is exposed by " ++ show (length possibleHomes) ++ " of your imports, so I am not\
1001− ++ " expose a `" ++ Name.toChars name ++ "` " ++ thing ++ ":"
998+ \ sure which one to use:"
1002 , D.indent 4 $ D.vcat $ map homeToYellowDoc possibleHomes
999 , D.indent 4 $ D.vcat $ map homeToYellowDoc possibleHomes
1003− , D.reflowLink "Read" "imports" "to learn how to clarify which one you want."
1000+ , D.reflow $
1001+ "I recommend using qualified names for imported values. I also recommend having\
1002+ \ at most one `exposing (..)` per file to make name clashes like this less common\
1003+ \ in the long run."
1004+ , D.link "Note" "Check out" "imports" "for more info on the import syntax."
@@ -1008,9 +1009,9 @@ ambiguousName source region maybePrefix name possibleHomes thing =
1009 homeToYellowDoc (ModuleName.Canonical _ home) =
1010 homeToYellowDoc (ModuleName.Canonical _ home) =
1010 if prefix == home then
1011 if prefix == home then
1011− D.blue "import" <+> D.dullyellow (D.fromName home)
1012+ D.cyan "import" <+> D.fromName home
1013− D.blue "import" <+> D.dullyellow (D.fromName home) <+> D.blue "as" <+> D.dullyellow (D.fromName prefix)
1014+ D.cyan "import" <+> D.fromName home <+> D.cyan "as" <+> D.fromName prefix
1015 eitherOrAny =
1016 eitherOrAny =
1016 if length possibleHomes == 2 then "either" else "any"
1017 if length possibleHomes == 2 then "either" else "any"