-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
better-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messages
Description
It's probably because inScopeCandidates does not faithfully copy the logic in Typer.findMember: If the import is a root import (i.e. from scala, java.lang or Predef` then it shadows the synthesized root import at the beginning of the program. That should be fixed as well (either in this PR or another one).
In current main, when we compile
import Predef.{Map as _}
val xx: Mop[Int, Int] = Mop()we see already:
~/workspace/dotty/tests/pos-custom-args/captures> sccs ../../new/test.scala
-- [E006] Not Found Error: ../../new/test.scala:3:8 ----------------------------
3 |val xx: Mop[Int, Int] = Mop()
| ^^^
| Not found: type Mop - did you mean Map?
|
| longer explanation available when compiling with `-explain`
-- [E006] Not Found Error: ../../new/test.scala:3:24 ---------------------------
3 |val xx: Mop[Int, Int] = Mop()
| ^^^
| Not found: Mop - did you mean Map?
|
| longer explanation available when compiling with `-explain`Those "did you mean" messages are also wrong.
Originally posted by @odersky in #24959 (comment)
Metadata
Metadata
Assignees
Labels
better-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messages