Skip to content

Commit

Permalink
Fix thread safety problem in runtime reflection
Browse files Browse the repository at this point in the history
In #9012, a `ReusableInstance` was added in the implenentation of
`TypeConstraint.contains`. This needs to be disabled in the
multi-threaded runtime reflection universe.
  • Loading branch information
retronym committed Jun 24, 2020
1 parent 98b9a1c commit 7dd5203
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -199,7 +199,7 @@ private[internal] trait TypeConstraints {
}
}

private[this] val containsCollectorInstances: ReusableInstance[ContainsCollector] = ReusableInstance(new ContainsCollector(null))
private[this] val containsCollectorInstances: ReusableInstance[ContainsCollector] = ReusableInstance(new ContainsCollector(null), enabled = isCompilerUniverse)

private[this] def containsSymbol(tp: Type, sym: Symbol): Boolean =
containsCollectorInstances.using { cc =>
Expand Down

0 comments on commit 7dd5203

Please sign in to comment.