File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
compiler/src/dotty/tools/dotc/core/classfile Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -916,17 +916,14 @@ class ClassfileParser(
916916 Array .empty
917917 }
918918 case _ =>
919- if (classfile.jpath == null ) {
920- report.error(" Could not load TASTY from .tasty for virtual file " + classfile)
919+ val dir = classfile.container
920+ val name = classfile.name.stripSuffix(" .class" ) + " .tasty"
921+ val tastyFileOrNull = dir.lookupName(name, false )
922+ if (tastyFileOrNull == null ) {
923+ report.error(s " Could not find TASTY file $name under $dir" )
921924 Array .empty
922- } else {
923- val plainFile = new PlainFile (io.File (classfile.jpath).changeExtension(" tasty" ))
924- if (plainFile.exists) plainFile.toByteArray
925- else {
926- report.error(" Could not find " + plainFile)
927- Array .empty
928- }
929- }
925+ } else
926+ tastyFileOrNull.toByteArray
930927 }
931928 if (tastyBytes.nonEmpty) {
932929 val reader = new TastyReader (bytes, 0 , 16 )
You can’t perform that action at this time.
0 commit comments