Skip to content

Commit 4b0f18c

Browse files
committed
Add use annotations in parameter info type for use parameters
1 parent 0be2091 commit 4b0f18c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ extension (sym: Symbol)
495495
*/
496496
def isUseParam(using Context): Boolean =
497497
sym.hasAnnotation(defn.UseAnnot)
498+
|| sym.info.hasAnnotation(defn.UseAnnot)
498499
|| sym.is(TypeParam)
499500
&& sym.owner.rawParamss.nestedExists: param =>
500501
param.is(TermParam) && param.hasAnnotation(defn.UseAnnot)

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4234,6 +4234,8 @@ object Types extends TypeUtils {
42344234
paramType = addAnnotation(paramType, defn.InlineParamAnnot, param)
42354235
if param.is(Erased) then
42364236
paramType = addAnnotation(paramType, defn.ErasedParamAnnot, param)
4237+
if param.isUseParam then
4238+
paramType = addAnnotation(paramType, defn.UseAnnot, param)
42374239
paramType
42384240

42394241
def adaptParamInfo(param: Symbol)(using Context): Type =

0 commit comments

Comments
 (0)