@@ -46,12 +46,19 @@ object Symbols {
4646 * @param coord The coordinates of the symbol (a position or an index)
4747 * @param id A unique identifier of the symbol (unique per ContextBase)
4848 */
49- class Symbol private [Symbols ] (private var myCoord : Coord , val id : Int )
49+ class Symbol private [Symbols ] (private var myCoord : Coord , val id : Int , val runUUID : String = " <no uuid> " )
5050 extends Designator , ParamInfo , SrcPos , printing.Showable {
5151
5252 type ThisName <: Name
5353
54- // assert(id != 723)
54+ val tracer : String | Null =
55+ if id == 2760 /* myerror before */ || id == 2756 /* compiletime2.package$ before */ || id == 2765 /* myerror after */ || id == 2757 /* compiletime2.package before */ || id == 2753 /* compiletime2.package after */ then
56+ val tracer = Thread .currentThread().getStackTrace().mkString(" \n " , " \n " , " \n " )
57+ tracer
58+ else
59+ null
60+
61+ // assert(id != 723)
5562
5663 def coord : Coord = myCoord
5764
@@ -76,6 +83,10 @@ object Symbols {
7683
7784 /** Set defining tree if this symbol retains its definition tree */
7885 def defTree_= (tree : Tree )(using Context ): Unit =
86+ val fname = denot.fullName.toString
87+ if fname.contains(" scala.compiletime" ) && ! fname.contains(" .ops" ) then
88+ if tracer != null then
89+ report.echo(i " ` ${denot.fullName}.defTree = $tree` [did assign? $retainsDefTree, id? ${id}, phase? ${ctx.phase.phaseName}, run? $runUUID, $tracer] " )
7990 if (retainsDefTree) myDefTree = tree
8091
8192 /** Does this symbol retain its definition tree?
@@ -368,8 +379,8 @@ object Symbols {
368379 type TermSymbol = Symbol { type ThisName = TermName }
369380 type TypeSymbol = Symbol { type ThisName = TypeName }
370381
371- class ClassSymbol private [Symbols ] (coord : Coord , val assocFile : AbstractFile , id : Int )
372- extends Symbol (coord, id) {
382+ class ClassSymbol private [Symbols ] (coord : Coord , val assocFile : AbstractFile , id : Int , runUUID : String )
383+ extends Symbol (coord, id, runUUID ) {
373384
374385 type ThisName = TypeName
375386
@@ -516,7 +527,7 @@ object Symbols {
516527 info : Type ,
517528 privateWithin : Symbol = NoSymbol ,
518529 coord : Coord = NoCoord )(using Context ): Symbol { type ThisName = N } = {
519- val sym = new Symbol (coord, ctx.base.nextSymId).asInstanceOf [Symbol { type ThisName = N }]
530+ val sym = new Symbol (coord, ctx.base.nextSymId, Option (ctx.run).map(_.uuid).getOrElse( " <no run> " ) ).asInstanceOf [Symbol { type ThisName = N }]
520531 val denot = SymDenotation (sym, owner, name, flags, info, privateWithin)
521532 sym.denot = denot
522533 sym
@@ -534,7 +545,7 @@ object Symbols {
534545 coord : Coord = NoCoord ,
535546 assocFile : AbstractFile = null )(using Context ): ClassSymbol
536547 = {
537- val cls = new ClassSymbol (coord, assocFile, ctx.base.nextSymId)
548+ val cls = new ClassSymbol (coord, assocFile, ctx.base.nextSymId, Option (ctx.run).map(_.uuid).getOrElse( " <no uuid> " ) )
538549 val denot = SymDenotation (cls, owner, name, flags, infoFn(cls), privateWithin)
539550 cls.denot = denot
540551 cls
0 commit comments