@@ -46,12 +46,19 @@ object Symbols {
46
46
* @param coord The coordinates of the symbol (a position or an index)
47
47
* @param id A unique identifier of the symbol (unique per ContextBase)
48
48
*/
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> " )
50
50
extends Designator , ParamInfo , SrcPos , printing.Showable {
51
51
52
52
type ThisName <: Name
53
53
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)
55
62
56
63
def coord : Coord = myCoord
57
64
@@ -76,6 +83,10 @@ object Symbols {
76
83
77
84
/** Set defining tree if this symbol retains its definition tree */
78
85
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] " )
79
90
if (retainsDefTree) myDefTree = tree
80
91
81
92
/** Does this symbol retain its definition tree?
@@ -368,8 +379,8 @@ object Symbols {
368
379
type TermSymbol = Symbol { type ThisName = TermName }
369
380
type TypeSymbol = Symbol { type ThisName = TypeName }
370
381
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 ) {
373
384
374
385
type ThisName = TypeName
375
386
@@ -516,7 +527,7 @@ object Symbols {
516
527
info : Type ,
517
528
privateWithin : Symbol = NoSymbol ,
518
529
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 }]
520
531
val denot = SymDenotation (sym, owner, name, flags, info, privateWithin)
521
532
sym.denot = denot
522
533
sym
@@ -534,7 +545,7 @@ object Symbols {
534
545
coord : Coord = NoCoord ,
535
546
assocFile : AbstractFile = null )(using Context ): ClassSymbol
536
547
= {
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> " ) )
538
549
val denot = SymDenotation (cls, owner, name, flags, infoFn(cls), privateWithin)
539
550
cls.denot = denot
540
551
cls
0 commit comments