@@ -289,11 +289,6 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
289289 }
290290 }
291291
292- def transformMemberDefThreadSafe (x : ValOrDefDef )(using Context ): Thicket = {
293- assert(! (x.symbol is Mutable ))
294- transformMemberDefThreadSafeNew(x)
295- }
296-
297292 /**
298293 * Create a threadsafe lazy accessor equivalent to the following code:
299294 * ```
@@ -370,7 +365,7 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
370365 * @param evaluating a reference to the `Evaluating` runtime object
371366 * @param nullValued a reference to the `NULL` runtime object
372367 */
373- def mkThreadSafeDefNew (methodSymbol : TermSymbol ,
368+ def mkThreadSafeDef (methodSymbol : TermSymbol ,
374369 claz : ClassSymbol ,
375370 target : Symbol ,
376371 rhs : Tree ,
@@ -446,10 +441,12 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
446441 ret
447442 }
448443
449- def transformMemberDefThreadSafeNew (x : ValOrDefDef )(using Context ): Thicket = {
444+ def transformMemberDefThreadSafe (x : ValOrDefDef )(using Context ): Thicket = {
450445 import dotty .tools .dotc .core .Types ._
451446 import dotty .tools .dotc .core .Flags ._
452447
448+ assert(! (x.symbol is Mutable ))
449+
453450 val runtimeModule = " scala.runtime.LazyVals"
454451 val tpe = x.tpe.widen.resultType.widen
455452 val claz = x.symbol.owner.asClass
@@ -502,7 +499,7 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
502499 This (claz)
503500
504501 val methodSymbol = x.symbol.asTerm
505- val accessor = mkThreadSafeDefNew (methodSymbol, claz, containerSymbol, x.rhs, tpe, offset, objCas,
502+ val accessor = mkThreadSafeDef (methodSymbol, claz, containerSymbol, x.rhs, tpe, offset, objCas,
506503 ref(waiting), evaluating, nullValued, swapOver)
507504 Thicket (containerTree, accessor)
508505 }
0 commit comments