File tree 3 files changed +16
-7
lines changed
compiler/src/dotty/tools/dotc
library/src/scala/annotation/internal
3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -972,6 +972,7 @@ class Definitions {
972
972
@ tu lazy val BooleanBeanPropertyAnnot : ClassSymbol = requiredClass(" scala.beans.BooleanBeanProperty" )
973
973
@ tu lazy val BodyAnnot : ClassSymbol = requiredClass(" scala.annotation.internal.Body" )
974
974
@ tu lazy val CapabilityAnnot : ClassSymbol = requiredClass(" scala.annotation.capability" )
975
+ @ tu lazy val CaptureCheckedAnnot : ClassSymbol = requiredClass(" scala.annotation.internal.CaptureChecked" )
975
976
@ tu lazy val ChildAnnot : ClassSymbol = requiredClass(" scala.annotation.internal.Child" )
976
977
@ tu lazy val ContextResultCountAnnot : ClassSymbol = requiredClass(" scala.annotation.internal.ContextResultCount" )
977
978
@ tu lazy val ProvisionalSuperClassAnnot : ClassSymbol = requiredClass(" scala.annotation.internal.ProvisionalSuperClass" )
Original file line number Diff line number Diff line change @@ -391,13 +391,13 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
391
391
for parent <- impl.parents do
392
392
Checking .checkTraitInheritance(parent.tpe.classSymbol, sym.asClass, parent.srcPos)
393
393
// Add SourceFile annotation to top-level classes
394
- if sym.owner.is(Package )
395
- && ctx.compilationUnit.source.exists
396
- && sym != defn. SourceFileAnnot
397
- then
398
- val reference = ctx.settings.sourceroot.value
399
- val relativePath = util. SourceFile .relativePath(ctx.compilationUnit.source, reference)
400
- sym.addAnnotation(Annotation .makeSourceFile(relativePath ))
394
+ if sym.owner.is(Package ) then
395
+ if ctx.compilationUnit.source.exists && sym != defn. SourceFileAnnot then
396
+ val reference = ctx.settings.sourceroot.value
397
+ val relativePath = util. SourceFile .relativePath(ctx.compilationUnit.source, reference)
398
+ sym.addAnnotation( Annotation .makeSourceFile(relativePath))
399
+ if ctx.settings. Ycc .value && sym != defn. CaptureCheckedAnnot then
400
+ sym.addAnnotation(Annotation (defn. CaptureCheckedAnnot ))
401
401
else
402
402
if ! sym.is(Param ) && ! sym.owner.isOneOf(AbstractOrTrait ) then
403
403
Checking .checkGoodBounds(tree.symbol)
Original file line number Diff line number Diff line change
1
+ package scala .annotation
2
+ package internal
3
+
4
+ /** A marker annotation on a toplevel class that indicates
5
+ * that the class was checked under -Ycc
6
+ */
7
+ class CaptureChecked extends StaticAnnotation
8
+
You can’t perform that action at this time.
0 commit comments