You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found out that there are some conditions that must be satisfied for this bug to occur:
There must be opaque type in object HTML
There must be nested package in the file where the raw method is used so that we can import it by absolute and relative path
There must by second usage of raw somewhere
Output
[error] -- [E049] Reference Error: /Users/fzybala/Documents/random/ambiguous-reference-bug/src/main/scala/dotty/tools/scaladoc/tasty/comments/markdown/bug.scala:8:4
[error] 8 | raw("asd").toString
[error] | ^^^
[error] | Reference to raw is ambiguous,
[error] | it is both imported by import bar.util.HTML._
[error] | and imported subsequently by import bar.util.HTML._
Expectation
Should compile
This problem caused CI to fail on one of my branches in Scaladoc: #14669. Of course double-import is not a good thing but usually compiler knows that it's the same thing.
The text was updated successfully, but these errors were encountered:
I tried to look into compiler where exactly this message is thrown and I got to TypeComparer. There's a method isSameRef that compares if two types are the same refs. When we don't satisfy one of conditions that I mentioned, the method is called with tp1 that shows: <overloaded bar.util.HTML.raw> and tp2 that shows: <overloaded bar.util.HTML.raw> and therefore it returns true. In the example that I've provided, the method gets other parameters: tp1 : <overloaded bar.util.HTML.raw> and tp2 :
Compiler version
Reproduced on newest nightly, 3.1.2-RC1, 3.1.2-RC2, 3.0.0
Minimized code
To reproduce this bug, we need three files:
I found out that there are some conditions that must be satisfied for this bug to occur:
object HTML
raw
method is used so that we can import it by absolute and relative pathraw
somewhereOutput
Expectation
Should compile
This problem caused CI to fail on one of my branches in Scaladoc: #14669. Of course double-import is not a good thing but usually compiler knows that it's the same thing.
The text was updated successfully, but these errors were encountered: