Skip to content
Merged
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
17 changes: 7 additions & 10 deletions compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -916,17 +916,14 @@ class ClassfileParser(
Array.empty
}
case _ =>
if (classfile.jpath == null) {
report.error("Could not load TASTY from .tasty for virtual file " + classfile)
val dir = classfile.container
val name = classfile.name.stripSuffix(".class") + ".tasty"
val tastyFileOrNull = dir.lookupName(name, false)
if (tastyFileOrNull == null) {
report.error(s"Could not find TASTY file $name under $dir")
Array.empty
} else {
val plainFile = new PlainFile(io.File(classfile.jpath).changeExtension("tasty"))
if (plainFile.exists) plainFile.toByteArray
else {
report.error("Could not find " + plainFile)
Array.empty
}
}
} else
tastyFileOrNull.toByteArray
}
if (tastyBytes.nonEmpty) {
val reader = new TastyReader(bytes, 0, 16)
Expand Down