Skip to content

Commit 3dcaf59

Browse files
committed
Drop hasAnnotation check on symbols for @use and @consume
1 parent 9bdf3a7 commit 3dcaf59

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/cc/CaptureOps.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,7 @@ extension (sym: Symbol)
497497
* @use-annotated term parameter that contains `sym` in its deep capture set.
498498
*/
499499
def isUseParam(using Context): Boolean =
500-
sym.hasAnnotation(defn.UseAnnot)
501-
|| sym.info.hasAnnotation(defn.UseAnnot)
500+
sym.info.hasAnnotation(defn.UseAnnot)
502501
|| sym.is(TypeParam)
503502
&& sym.owner.rawParamss.nestedExists: param =>
504503
param.is(TermParam) && param.hasAnnotation(defn.UseAnnot)
@@ -508,8 +507,7 @@ extension (sym: Symbol)
508507

509508
/** `sym` or its info is annotated with `@consume`. */
510509
def isConsumeParam(using Context): Boolean =
511-
sym.hasAnnotation(defn.ConsumeAnnot)
512-
|| sym.info.hasAnnotation(defn.ConsumeAnnot)
510+
sym.info.hasAnnotation(defn.ConsumeAnnot)
513511

514512
def isUpdateMethod(using Context): Boolean =
515513
sym.isAllOf(Mutable | Method, butNot = Accessor)

0 commit comments

Comments
 (0)