File tree 1 file changed +8
-16
lines changed
compiler/src/dotty/tools/dotc/core/classfile
1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -916,22 +916,14 @@ class ClassfileParser(
916
916
Array .empty
917
917
}
918
918
case _ =>
919
- if (classfile.jpath == null ) {
920
- val tastyFileOrNull = classfile.container
921
- .lookupName(classfile.name.stripSuffix(" .class" ) + " .tasty" , false )
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
927
- } else {
928
- val plainFile = new PlainFile (io.File (classfile.jpath).changeExtension(" tasty" ))
929
- if (plainFile.exists) plainFile.toByteArray
930
- else {
931
- report.error(" Could not find " + plainFile)
932
- Array .empty
933
- }
934
- }
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" )
924
+ Array .empty
925
+ } else
926
+ tastyFileOrNull.toByteArray
935
927
}
936
928
if (tastyBytes.nonEmpty) {
937
929
val reader = new TastyReader (bytes, 0 , 16 )
You can’t perform that action at this time.
0 commit comments