Skip to content

Commit 9ede238

Browse files
committed
Get rid of Thicket(List(...)) as an expression
Thicket has a vararg constructor, so this syntax is redundant.
1 parent 80cbe11 commit 9ede238

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ object Parsers {
614614
val interpolator = in.name
615615
in.nextToken()
616616
while (in.token == STRINGPART) {
617-
segmentBuf += Thicket(List(
617+
segmentBuf += Thicket(
618618
literal(),
619619
atPos(in.offset) {
620620
if (in.token == IDENTIFIER)
@@ -630,7 +630,7 @@ object Parsers {
630630
syntaxErrorOrIncomplete("error in interpolated string: identifier or block expected")
631631
EmptyTree
632632
}
633-
}))
633+
})
634634
}
635635
if (in.token == STRINGLIT) segmentBuf += literal()
636636
InterpolatedString(interpolator, segmentBuf.toList)

src/dotty/tools/dotc/transform/LazyVals.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,14 @@ class LazyVals extends MiniPhaseTransform with IdentityDenotTransformer {
220220
val containerTree = ValDef(containerSymbol, defaultValue(tpe))
221221
if (x.tpe.isNotNull && tpe <:< defn.ObjectType) { // can use 'null' value instead of flag
222222
val slowPath = DefDef(x.symbol.asTerm, mkDefNonThreadSafeNonNullable(containerSymbol, x.rhs))
223-
Thicket(List(containerTree, slowPath))
223+
Thicket(containerTree, slowPath)
224224
}
225225
else {
226226
val flagName = ctx.freshName(x.name ++ StdNames.nme.BITMAP_PREFIX).toTermName
227227
val flagSymbol = ctx.newSymbol(x.symbol.owner, flagName, containerFlags | Flags.Private, defn.BooleanType).enteredAfter(this)
228228
val flag = ValDef(flagSymbol, Literal(Constants.Constant(false)))
229229
val slowPath = DefDef(x.symbol.asTerm, mkNonThreadSafeDef(ref(containerSymbol), ref(flagSymbol), x.rhs))
230-
Thicket(List(containerTree, flag, slowPath))
230+
Thicket(containerTree, flag, slowPath)
231231
}
232232
}
233233

@@ -390,8 +390,8 @@ class LazyVals extends MiniPhaseTransform with IdentityDenotTransformer {
390390

391391
val accessor = mkThreadSafeDef(x.symbol.asTerm, claz, ord, containerSymbol, x.rhs, tpe, offset, getFlag, state, cas, setFlag, wait)
392392
if (flag eq EmptyTree)
393-
Thicket(List(containerTree, accessor))
394-
else Thicket(List(containerTree, flag, accessor))
393+
Thicket(containerTree, accessor)
394+
else Thicket(containerTree, flag, accessor)
395395
}
396396
}
397397

0 commit comments

Comments
 (0)