Skip to content

Fix edge case in ReadTasty.scala #10596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ class ReadTasty extends Phase {
def moduleClass = clsd.owner.info.member(className.moduleClassName).symbol
compilationUnit(clsd.classSymbol).orElse(compilationUnit(moduleClass))
case _ =>
cannotUnpickle(s"no class file was found")
staticRef(className.moduleClassName) match {
case clsd: ClassDenotation =>
compilationUnit(clsd.classSymbol)
case denot =>
cannotUnpickle(s"no class file was found for denot: $denot")
}
}
case unit =>
Some(unit)
Expand Down
12 changes: 12 additions & 0 deletions scala3doc-testcases/src/example/typeAndObjects/package.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package example

// Ala fails Ola does not
package object typeAndObjects:
type Ala

package typeAndObjects {
object Ala
}

type Ola
object Ola