Skip to content

Commit e7f44c9

Browse files
Load .tasty files from in-memory file systems too
1 parent 8ed6b59 commit e7f44c9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,13 @@ class ClassfileParser(
917917
}
918918
case _ =>
919919
if (classfile.jpath == null) {
920-
report.error("Could not load TASTY from .tasty for virtual file " + classfile)
921-
Array.empty
920+
val tastyFileOrNull = classfile.container
921+
.lookupName(classfile.name.stripSuffix(".class") + ".tasty")
922+
if (tastyFileOrNull == null) {
923+
report.error("Could not load TASTY from .tasty for virtual file " + classfile)
924+
Array.empty
925+
} else
926+
tastyFileOrNull.toByteArray
922927
} else {
923928
val plainFile = new PlainFile(io.File(classfile.jpath).changeExtension("tasty"))
924929
if (plainFile.exists) plainFile.toByteArray

0 commit comments

Comments
 (0)