@@ -366,9 +366,10 @@ object Symbols {
366
366
val associatedFile1 = if (associatedFile == null ) owner.associatedFile else associatedFile
367
367
368
368
if isClass then
369
- newClassSymbol(owner, name.asTypeName, flags, _ => info, privateWithin, coord1, associatedFile1)
369
+ val d = denot.asClass.tastyVersion
370
+ newClassSymbol(owner, name.asTypeName, flags, _ => info, privateWithin, coord1, associatedFile1, initTastyVersion = d)
370
371
else
371
- newSymbol(owner, name, flags, info, privateWithin, coord1)
372
+ newSymbol(owner, name, flags, info, privateWithin, coord1, initTastyVersion = - 1 ) // AR
372
373
}
373
374
374
375
// -------- Printing --------------------------------------------------------
@@ -519,7 +520,7 @@ object Symbols {
519
520
privateWithin : Symbol = NoSymbol ,
520
521
coord : Coord = NoCoord ,
521
522
nestingLevel : Int = ctx.nestingLevel,
522
- initTastyVersion : Long = - 1 ): Symbol { type ThisName = N } = {
523
+ initTastyVersion : Long ): Symbol { type ThisName = N } = {
523
524
val sym = new Symbol (coord, ctx.base.nextSymId, nestingLevel).asInstanceOf [Symbol { type ThisName = N }]
524
525
val denot = SymDenotation (sym, owner, name, flags, info, privateWithin, initTastyVersion)
525
526
sym.denot = denot
@@ -537,7 +538,7 @@ object Symbols {
537
538
privateWithin : Symbol = NoSymbol ,
538
539
coord : Coord = NoCoord ,
539
540
assocFile : AbstractFile | Null = null ,
540
- initTastyVersion : Long = - 1 )(using Context ): ClassSymbol
541
+ initTastyVersion : Long )(using Context ): ClassSymbol
541
542
= {
542
543
val cls = new ClassSymbol (coord, assocFile, ctx.base.nextSymId, ctx.nestingLevel)
543
544
val denot = SymDenotation (cls, owner, name, flags, infoFn(cls), privateWithin, initTastyVersion)
@@ -555,11 +556,12 @@ object Symbols {
555
556
selfInfo : Type = NoType ,
556
557
privateWithin : Symbol = NoSymbol ,
557
558
coord : Coord = NoCoord ,
558
- assocFile : AbstractFile | Null = null )(using Context ): ClassSymbol =
559
+ assocFile : AbstractFile | Null = null ,
560
+ initTastyVersion : Long )(using Context ): ClassSymbol =
559
561
newClassSymbol(
560
562
owner, name, flags,
561
563
ClassInfo (owner.thisType, _, parents, decls, selfInfo),
562
- privateWithin, coord, assocFile)
564
+ privateWithin, coord, assocFile, initTastyVersion )
563
565
564
566
/** Same as `newCompleteClassSymbol` except that `parents` can be a list of arbitrary
565
567
* types which get normalized into type refs and parameter bindings.
@@ -572,15 +574,16 @@ object Symbols {
572
574
selfInfo : Type = NoType ,
573
575
privateWithin : Symbol = NoSymbol ,
574
576
coord : Coord = NoCoord ,
575
- assocFile : AbstractFile | Null = null )(using Context ): ClassSymbol = {
577
+ assocFile : AbstractFile | Null = null ,
578
+ initTastyVersion : Long )(using Context ): ClassSymbol = {
576
579
def completer = new LazyType {
577
580
def complete (denot : SymDenotation )(using Context ): Unit = {
578
581
val cls = denot.asClass.classSymbol
579
582
val decls = newScope
580
583
denot.info = ClassInfo (owner.thisType, cls, parentTypes.map(_.dealias), decls, selfInfo)
581
584
}
582
585
}
583
- newClassSymbol(owner, name, flags, completer, privateWithin, coord, assocFile)
586
+ newClassSymbol(owner, name, flags, completer, privateWithin, coord, assocFile, initTastyVersion )
584
587
}
585
588
586
589
def newRefinedClassSymbol (coord : Coord = NoCoord )(using Context ): ClassSymbol =
@@ -598,15 +601,16 @@ object Symbols {
598
601
infoFn : (TermSymbol , ClassSymbol ) => Type , // typically a ModuleClassCompleterWithDecls
599
602
privateWithin : Symbol = NoSymbol ,
600
603
coord : Coord = NoCoord ,
601
- assocFile : AbstractFile | Null = null )(using Context ): TermSymbol
604
+ assocFile : AbstractFile | Null = null ,
605
+ initTastyVersion : Long )(using Context ): TermSymbol
602
606
= {
603
607
val base = owner.thisType
604
608
val modclsFlags = clsFlags | ModuleClassCreationFlags
605
609
val modclsName = name.toTypeName.adjustIfModuleClass(modclsFlags)
606
610
val module = newSymbol(
607
- owner, name, modFlags | ModuleValCreationFlags , NoCompleter , privateWithin, coord)
611
+ owner, name, modFlags | ModuleValCreationFlags , NoCompleter , privateWithin, coord, initTastyVersion = initTastyVersion )
608
612
val modcls = newClassSymbol(
609
- owner, modclsName, modclsFlags, infoFn(module, _), privateWithin, coord, assocFile)
613
+ owner, modclsName, modclsFlags, infoFn(module, _), privateWithin, coord, assocFile, initTastyVersion )
610
614
module.info =
611
615
if (modcls.isCompleted) TypeRef (owner.thisType, modcls)
612
616
else new ModuleCompleter (modcls)
@@ -627,12 +631,13 @@ object Symbols {
627
631
decls : Scope ,
628
632
privateWithin : Symbol = NoSymbol ,
629
633
coord : Coord = NoCoord ,
630
- assocFile : AbstractFile | Null = null )(using Context ): TermSymbol =
634
+ assocFile : AbstractFile | Null = null ,
635
+ initTastyVersion : Long )(using Context ): TermSymbol =
631
636
newModuleSymbol(
632
637
owner, name, modFlags, clsFlags,
633
638
(module, modcls) => ClassInfo (
634
639
owner.thisType, modcls, parents, decls, TermRef (owner.thisType, module)),
635
- privateWithin, coord, assocFile)
640
+ privateWithin, coord, assocFile, initTastyVersion )
636
641
637
642
/** Same as `newCompleteModuleSymbol` except that `parents` can be a list of arbitrary
638
643
* types which get normalized into type refs and parameter bindings.
@@ -646,18 +651,20 @@ object Symbols {
646
651
decls : Scope ,
647
652
privateWithin : Symbol = NoSymbol ,
648
653
coord : Coord = NoCoord ,
649
- assocFile : AbstractFile | Null = null )(using Context ): TermSymbol = {
654
+ assocFile : AbstractFile | Null = null ,
655
+ initTastyVersion : Long )(using Context ): TermSymbol = {
650
656
def completer (module : Symbol ) = new LazyType {
651
657
def complete (denot : SymDenotation )(using Context ): Unit = {
652
658
val cls = denot.asClass.classSymbol
653
659
val decls = newScope
654
660
denot.info = ClassInfo (owner.thisType, cls, parentTypes.map(_.dealias), decls, TermRef (owner.thisType, module))
661
+ // TODO? set tastyVersion
655
662
}
656
663
}
657
664
newModuleSymbol(
658
665
owner, name, modFlags, clsFlags,
659
666
(module, modcls) => completer(module),
660
- privateWithin, coord, assocFile)
667
+ privateWithin, coord, assocFile, initTastyVersion )
661
668
}
662
669
663
670
/** Create a package symbol with associated package class
@@ -794,7 +801,7 @@ object Symbols {
794
801
def newErrorSymbol (owner : Symbol , name : Name , msg : Message )(using Context ): Symbol = {
795
802
val errType = ErrorType (msg)
796
803
newSymbol(owner, name, SyntheticArtifact ,
797
- if (name.isTypeName) TypeAlias (errType) else errType)
804
+ if (name.isTypeName) TypeAlias (errType) else errType, initTastyVersion = - 1 )
798
805
}
799
806
800
807
/** Map given symbols, subjecting their attributes to the mappings
0 commit comments