File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import Hashable.*
3030import Uniques .*
3131import collection .mutable
3232import config .Config
33+ import config .Feature
3334import config .Feature .sourceVersion
3435import config .SourceVersion
3536import annotation .{tailrec , constructorOnly }
@@ -6483,10 +6484,13 @@ object Types extends TypeUtils {
64836484 mapCapturingType(tp, parent, refs, variance)
64846485
64856486 case tp @ AnnotatedType (underlying, annot) =>
6486- val underlying1 = this (underlying)
6487- val annot1 = annot.mapWith(this )
6488- if annot1 eq EmptyAnnotation then underlying1
6489- else derivedAnnotatedType(tp, underlying1, annot1)
6487+ if annot.symbol.isRetainsLike && ! Feature .ccEnabledSomewhere then
6488+ this (underlying) // strip retains like annotations unless capture checking is enabled
6489+ else
6490+ val underlying1 = this (underlying)
6491+ val annot1 = annot.mapWith(this )
6492+ if annot1 eq EmptyAnnotation then underlying1
6493+ else derivedAnnotatedType(tp, underlying1, annot1)
64906494
64916495 case _ : ThisType
64926496 | _ : BoundType
You can’t perform that action at this time.
0 commit comments