Skip to content

Commit 1922c0f

Browse files
authored
chore: do not render consume update in scaladoc (#23760)
In #23755, a `consume` method now implies an `update` method. This PR changes the rendering in scaladoc to avoid printing `consume update def` and rather print `consume def`. Note that at the moment, in #23755, writing `consume update def` or `consume def` has the same effect. An error or a warning might be added in the feature to highlight that `update` in `consume update def` is a redundant modifier. [skip ci]
2 parents 644bd7f + fe8937d commit 1922c0f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scaladoc/src/dotty/tools/scaladoc/tasty/ClassLikeSupport.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ trait ClassLikeSupport:
2525
def getExtraModifiers(): Seq[Modifier] =
2626
var mods = SymOps.getExtraModifiers(symbol)()
2727
if ccEnabled && symbol.flags.is(Flags.Mutable) then
28-
mods :+= Modifier.Update
29-
if ccEnabled && symbol.hasAnnotation(cc.CaptureDefs.ConsumeAnnot) then
30-
mods :+= Modifier.Consume
28+
if symbol.hasAnnotation(cc.CaptureDefs.ConsumeAnnot) then
29+
mods :+= Modifier.Consume
30+
else
31+
mods :+= Modifier.Update
3132
mods
3233
}
3334

0 commit comments

Comments
 (0)