@@ -8,7 +8,7 @@ import dotty.tools.tasty.{ TastyReader, TastyHeaderUnpickler }
8
8
import Contexts ._ , Symbols ._ , Types ._ , Names ._ , StdNames ._ , NameOps ._ , Scopes ._ , Decorators ._
9
9
import SymDenotations ._ , unpickleScala2 .Scala2Unpickler ._ , Constants ._ , Annotations ._ , util .Spans ._
10
10
import NameKinds .DefaultGetterName
11
- import ast .tpd ._
11
+ import ast .tpd ._ , util . _
12
12
import java .io .{ ByteArrayInputStream , ByteArrayOutputStream , DataInputStream , IOException }
13
13
14
14
import java .lang .Integer .toHexString
@@ -728,6 +728,12 @@ class ClassfileParser(
728
728
i < attrs
729
729
}
730
730
731
+ val sourceFile : SourceFile =
732
+ if scan(tpnme.SourceFileATTR ) then
733
+ val attrLen = in.nextInt
734
+ SourceFile .virtual(pool.getName(in.nextChar).toString, " " )
735
+ else NoSource
736
+
731
737
def unpickleScala (bytes : Array [Byte ]): Some [Embedded ] = {
732
738
val allowed = ctx.settings.Yscala2Unpickler .value
733
739
@@ -750,7 +756,7 @@ class ClassfileParser(
750
756
751
757
def unpickleTASTY (bytes : Array [Byte ]): Some [Embedded ] = {
752
758
val unpickler = new tasty.DottyUnpickler (bytes)
753
- unpickler.enter(roots = Set (classRoot, moduleRoot, moduleRoot.sourceModule))(ctx.withSource(util. NoSource ))
759
+ unpickler.enter(roots = Set (classRoot, moduleRoot, moduleRoot.sourceModule))(ctx.withSource(sourceFile ))
754
760
Some (unpickler)
755
761
}
756
762
0 commit comments