@@ -987,20 +987,21 @@ ambiguousName source region maybePrefix name possibleHomes thing =
987987 Nothing ->
988988 let
989989 homeToYellowDoc (ModuleName.Canonical _ home) =
990− D.dullyellow (D.fromName home)
991−
992− bothOrAll =
993− if length possibleHomes == 2 then "both" else "all"
990+ D.dullyellow (D.fromName home <> "." <> D.fromName name)
994991 in
995992 (
996− D.reflow $ "This usage of `" ++ Name.toChars name ++ "` is ambiguous."
993+ D.reflow $ "This usage of `" ++ Name.toChars name ++ "` is ambiguous:"
997994 ,
998995 D.stack
999996 [ D.reflow $
1000− "Check your imports. The following modules " ++ bothOrAll
1001− ++ " expose a `" ++ Name.toChars name ++ "` " ++ thing ++ ":"
997+ "This name is exposed by " ++ show (length possibleHomes) ++ " of your imports, so I am not\
998+ \ sure which one to use:"
1002999 , 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."
10041005 ]
10051006 )
10061007
@@ -1008,9 +1009,9 @@ ambiguousName source region maybePrefix name possibleHomes thing =
10081009 let
10091010 homeToYellowDoc (ModuleName.Canonical _ home) =
10101011 if prefix == home then
1011− D.blue "import" <+> D.dullyellow (D.fromName home)
1012+ D.cyan "import" <+> D.fromName home
10121013 else
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
10141015
10151016 eitherOrAny =
10161017 if length possibleHomes == 2 then "either" else "any"