1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
package scala.reflect
package runtime
import internal.Flags.DEFERRED
trait SynchronizedSymbols extends internal.Symbols { self: SymbolTable =>
override protected def nextId() = synchronized { super.nextId() }
override protected def freshExistentialName(suffix: String) =
synchronized { super.freshExistentialName(suffix) }
// Set the fields which point companions at one another. Returns the module.
override def connectModuleToClass(m: ModuleSymbol, moduleClass: ClassSymbol): ModuleSymbol =
synchronized { super.connectModuleToClass(m, moduleClass) }
override def newFreeVar(name: TermName, tpe: Type, value: Any, newFlags: Long = 0L): FreeVar =
new FreeVar(name, value) with SynchronizedTermSymbol initFlags newFlags setInfo tpe
override protected def makeNoSymbol: NoSymbol = new NoSymbol with SynchronizedSymbol
trait SynchronizedSymbol extends Symbol {
override def rawflags = synchronized { super.rawflags }
override def rawflags_=(x: Long) = synchronized { super.rawflags_=(x) }
override def rawowner = synchronized { super.rawowner }
override def owner_=(owner: Symbol) = synchronized { super.owner_=(owner) }
override def validTo = synchronized { super.validTo }
override def validTo_=(x: Period) = synchronized { super.validTo_=(x) }
override def pos = synchronized { super.pos }
override def setPos(pos: Position): this.type = { synchronized { super.setPos(pos) }; this }
override def privateWithin = synchronized { super.privateWithin }
override def privateWithin_=(sym: Symbol) = synchronized { super.privateWithin_=(sym) }
override def info = synchronized { super.info }
override def info_=(info: Type) = synchronized { super.info_=(info) }
override def updateInfo(info: Type): Symbol = synchronized { super.updateInfo(info) }
override def rawInfo: Type = synchronized { super.rawInfo }
override def typeParams: List[Symbol] = synchronized { super.typeParams }
override def reset(completer: Type) = synchronized { super.reset(completer) }
override def infosString: String = synchronized { super.infosString }
override def annotations: List[AnnotationInfo] = synchronized { super.annotations }
override def setAnnotations(annots: List[AnnotationInfo]): this.type = { synchronized { super.setAnnotations(annots) }; this }
// ------ creators -------------------------------------------------------------------
override protected def createAbstractTypeSymbol(name: TypeName, pos: Position, newFlags: Long): AbstractTypeSymbol =
new AbstractTypeSymbol(this, pos, name) with SynchronizedTypeSymbol initFlags newFlags
override protected def createAliasTypeSymbol(name: TypeName, pos: Position, newFlags: Long): AliasTypeSymbol =
new AliasTypeSymbol(this, pos, name) with SynchronizedTypeSymbol initFlags newFlags
override protected def createTypeSkolemSymbol(name: TypeName, origin: AnyRef, pos: Position, newFlags: Long): TypeSkolem =
new TypeSkolem(this, pos, name, origin) with SynchronizedTypeSymbol initFlags newFlags
override protected def createClassSymbol(name: TypeName, pos: Position, newFlags: Long): ClassSymbol =
new ClassSymbol(this, pos, name) with SynchronizedClassSymbol initFlags newFlags
override protected def createModuleClassSymbol(name: TypeName, pos: Position, newFlags: Long): ModuleClassSymbol =
new ModuleClassSymbol(this, pos, name) with SynchronizedModuleClassSymbol initFlags newFlags
override protected def createPackageClassSymbol(name: TypeName, pos: Position, newFlags: Long): PackageClassSymbol =
new PackageClassSymbol(this, pos, name) with SynchronizedModuleClassSymbol initFlags newFlags
override protected def createRefinementClassSymbol(pos: Position, newFlags: Long): RefinementClassSymbol =
new RefinementClassSymbol(this, pos) with SynchronizedClassSymbol initFlags newFlags
override protected def createImplClassSymbol(name: TypeName, pos: Position, newFlags: Long): ClassSymbol =
new ClassSymbol(this, pos, name) with ImplClassSymbol with SynchronizedClassSymbol initFlags newFlags
override protected def createPackageObjectClassSymbol(pos: Position, newFlags: Long): PackageObjectClassSymbol =
new PackageObjectClassSymbol(this, pos) with SynchronizedClassSymbol initFlags newFlags
override protected def createTermSymbol(name: TermName, pos: Position, newFlags: Long): TermSymbol =
new TermSymbol(this, pos, name) with SynchronizedTermSymbol initFlags newFlags
override protected def createMethodSymbol(name: TermName, pos: Position, newFlags: Long): MethodSymbol =
new MethodSymbol(this, pos, name) with SynchronizedMethodSymbol initFlags newFlags
override protected def createModuleSymbol(name: TermName, pos: Position, newFlags: Long): ModuleSymbol =
new ModuleSymbol(this, pos, name) with SynchronizedTermSymbol initFlags newFlags
override protected def createPackageSymbol(name: TermName, pos: Position, newFlags: Long): PackageSymbol =
new PackageSymbol(this, pos, name) with SynchronizedTermSymbol initFlags newFlags
// TODO
// override protected def createValueParameterSymbol(name: TermName, pos: Position, newFlags: Long)
// override protected def createValueMemberSymbol(name: TermName, pos: Position, newFlags: Long)
}
// ------- subclasses ---------------------------------------------------------------------
trait SynchronizedTermSymbol extends TermSymbol with SynchronizedSymbol {
override def name_=(x: Name) = synchronized { super.name_=(x) }
override def rawname = synchronized { super.rawname }
override def referenced: Symbol = synchronized { super.referenced }
override def referenced_=(x: Symbol) = synchronized { super.referenced_=(x) }
}
trait SynchronizedMethodSymbol extends MethodSymbol with SynchronizedTermSymbol {
override def typeAsMemberOf(pre: Type): Type = synchronized { super.typeAsMemberOf(pre) }
}
trait SynchronizedTypeSymbol extends TypeSymbol with SynchronizedSymbol {
override def name_=(x: Name) = synchronized { super.name_=(x) }
override def rawname = synchronized { super.rawname }
override def typeConstructor: Type = synchronized { super.typeConstructor }
override def tpe: Type = synchronized { super.tpe }
}
trait SynchronizedClassSymbol extends ClassSymbol with SynchronizedTypeSymbol {
override def sourceFile = synchronized { super.sourceFile }
override def sourceFile_=(f: AbstractFileType) = synchronized { super.sourceFile_=(f) }
override def thisSym: Symbol = synchronized { super.thisSym }
override def thisType: Type = synchronized { super.thisType }
override def typeOfThis: Type = synchronized { super.typeOfThis }
override def typeOfThis_=(tp: Type) = synchronized { super.typeOfThis_=(tp) }
override def children = synchronized { super.children }
override def addChild(sym: Symbol) = synchronized { super.addChild(sym) }
}
trait SynchronizedModuleClassSymbol extends ModuleClassSymbol with SynchronizedClassSymbol {
override def sourceModule = synchronized { super.sourceModule }
override def sourceModule_=(module: Symbol) = synchronized { super.sourceModule_=(module: Symbol) }
override def implicitMembers: List[Symbol] = synchronized { super.implicitMembers }
}
}
|