File tree 2 files changed +5
-1
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ import collection.mutable
13
13
14
14
object NameKinds {
15
15
16
+ // These are sharable since all NameKinds are created eagerly at the start of the program
17
+ // before any concurrent threads are forked. for this to work, NameKinds should never
18
+ // be created lazily or in modules that start running after compilers are forked.
16
19
@ sharable private val simpleNameKinds = new mutable.HashMap [Int , ClassifiedNameKind ]
17
20
@ sharable private val qualifiedNameKinds = new mutable.HashMap [Int , QualifiedNameKind ]
18
21
@ sharable private val uniqueNameKinds = new mutable.HashMap [String , UniqueNameKind ]
Original file line number Diff line number Diff line change @@ -134,7 +134,8 @@ object Names {
134
134
def info : NameInfo = SimpleTermNameKind .info
135
135
def underlying : TermName = unsupported(" underlying" )
136
136
137
- @ sharable private var derivedNames : AnyRef /* SimpleMap | j.u.HashMap */ =
137
+ @ sharable // because of synchronized block in `and`
138
+ private var derivedNames : AnyRef /* SimpleMap | j.u.HashMap */ =
138
139
SimpleMap .Empty [NameInfo ]
139
140
140
141
private def getDerived (info : NameInfo ): DerivedTermName /* | Null */ = derivedNames match {
You can’t perform that action at this time.
0 commit comments