scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
230 stars 21 forks source link

scaladoc with extra `.` characters fails with hard to decipher error message #12928

Closed Quafadas closed 5 months ago

Quafadas commented 5 months ago

Reproduction steps

Scala version: (Is the bug only in Scala 3.x? If so, report it at https://github.com/lampepfl/dotty/issues/new/choose instead.)

3.3.1, 3.3.2-RC1, 3.4.0-RC1

save this, in ext.ret.scala

package vecxt

export Retentions.*

object Retentions:
    opaque type Retention = Double
    extension (x: Retention)
        inline def retention: Double = x
end Retentions
simon@Simons-Mac-mini scaladoc % scala-cli doc ext.ret.scala -o scaladoc -f
Compiling project (Scala 3.3.1, JVM (21))
Compiled project (Scala 3.3.1, JVM (21))
class vecxt.ext.retention$package cannot be unpickled because no class file was found for denot: val <none>
1 error found
[error]  Scaladoc generation failed (exit code: 1)

But if you remove the .ret in the middle of the filename, then scaladoc succeeds.

Problem

Explain how the above behavior isn't what you expected.

ext.ret.scala is (in my mind) a valid name for source code file.

Potential duplicate, although that issue may have a wider scope than scaladoc and I got a little lost reading it. https://github.com/lampepfl/dotty/issues/16036 https://github.com/lampepfl/dotty/issues/16036#issuecomment-1707400364

SethTisue commented 5 months ago

Scala version: (Is the bug only in Scala 3.x? If so, report it at lampepfl/dotty/issues/new/choose instead.)

som-snytt commented 5 months ago

I took a look at the time, scratched my head because it sounded familiar, then found the dotty comment which was already linked here. This is a duplicate of the comment; it's not obvious that it's a separate issue, as they have no idea what caused the problem for scalac.