diff --git a/src/library/scala/collection/immutable/HashSet.scala b/src/library/scala/collection/immutable/HashSet.scala index 96dce59f5494..c35f7e6b2965 100644 --- a/src/library/scala/collection/immutable/HashSet.scala +++ b/src/library/scala/collection/immutable/HashSet.scala @@ -1279,8 +1279,9 @@ object HashSet extends ImmutableSetFactory[HashSet] { } override def result(): HashSet[A] = { - rootNode = nullToEmpty(makeImmutable(rootNode)) - rootNode + rootNode = nullToEmpty(makeImmutable(rootNode)) + VM.releaseFence() + rootNode }