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
scalac prefers the wrong binding for internal and compilation succeeds.
dotc:
-- [E093] Syntax Error: ./b/Test.scala:6:6 -------------------------------------
6 |class Probe extends internal
| ^
| class Probe cannot extend final package a.internal
longer explanation available when compiling with `-explain`
-- Error: ./b/Test.scala:6:20 --------------------------------------------------
6 |class Probe extends internal
| ^^^^^^^^
| a.internal does not have a constructor
2 errors found
If instead
package b
object internal
then
./b/Test.scala:9: error: package a.internal is not a value
println(internal)
^
1 error
The spec makes this clear: "unlike other objects, they can't be used as values, only in selections. Other terms/types can't have the same fully qualified name." [paraphrased. -Ed.]
Uh oh!
There was an error while loading. Please reload this page.
reproduction steps
using Scala 2.13.3,
problem
scalac prefers the wrong binding for
internal
and compilation succeeds.dotc:
If instead
then
Reported at scala/scala3#9899
The text was updated successfully, but these errors were encountered: