Use FQCN in type error message if two or more types have the same name

I recently encountered a confusing type error message because I had absentmindedly named a class ´String´ (details here). The error message did not clarify however that the two types named were in fact not the same class. As this was the first time trying out Scala 3, I thought it was due to some new dependent typing for string literals, but couldn’t figure out the proper syntax for it. I think it would have been quite helpful if the error message replaced the type names with their FQCNs when they clash with another one. Potentially even if that other class is not named in the message, but is available in the current scope, just to be explicit.

5 Likes

That’s a good suggestion. Can you open as issue at dotty.epfl.ch so we can track this?

Sure thing! I assume you meant this repo?

Feature requests is fine. It could also have been a straight issue at dotty.epfl.ch. Anyway, thanks for raising the subject!