We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21bbc6e commit 913bc49Copy full SHA for 913bc49
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -2675,7 +2675,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
2675
val arg1 = typed(tree.arg, pt)
2676
if (ctx.mode is Mode.Type) {
2677
val cls = annot1.symbol.maybeOwner
2678
- if cls == defn.RetainsAnnot || cls == defn.RetainsByNameAnnot then
+ if ctx.settings.Ycc.value
2679
+ && (cls == defn.RetainsAnnot || cls == defn.RetainsByNameAnnot)
2680
+ then
2681
CheckCaptures.checkWellformed(annot1)
2682
if arg1.isType then
2683
assignType(cpy.Annotated(tree)(arg1, annot1), arg1, annot1)
0 commit comments