Skip to content

Commit 1d3c55a

Browse files
committed
Revert "Drop hasAnnotation check on symbols for @use and @consume"
This reverts commit 3dcaf59.
1 parent 3dcaf59 commit 1d3c55a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ 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.info.hasAnnotation(defn.UseAnnot)
500+
sym.hasAnnotation(defn.UseAnnot)
501+
|| sym.info.hasAnnotation(defn.UseAnnot)
501502
|| sym.is(TypeParam)
502503
&& sym.owner.rawParamss.nestedExists: param =>
503504
param.is(TermParam) && param.hasAnnotation(defn.UseAnnot)
@@ -507,7 +508,8 @@ extension (sym: Symbol)
507508

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

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

0 commit comments

Comments
 (0)