Skip to content

Commit ab2935a

Browse files
committed
AST: Introduce @_primaryAssociatedType attribute
1 parent e7e5367 commit ab2935a

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

include/swift/AST/Attr.def

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,10 @@ CONTEXTUAL_SIMPLE_DECL_ATTR(distributed, DistributedActor,
657657
APIBreakingToAdd | APIBreakingToRemove,
658658
118)
659659

660-
// 119 is unused
660+
SIMPLE_DECL_ATTR(_primaryAssociatedType,
661+
PrimaryAssociatedType, OnAssociatedType | UserInaccessible |
662+
APIStableToAdd | ABIStableToAdd | APIBreakingToRemove | ABIStableToRemove,
663+
119)
661664

662665
SIMPLE_DECL_ATTR(_assemblyVision, EmitAssemblyVisionRemarks,
663666
OnFunc | UserInaccessible | NotSerialized | OnNominalType |

lib/Sema/TypeCheckAttr.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
273273
void visitNoImplicitCopyAttr(NoImplicitCopyAttr *attr);
274274

275275
void visitUnavailableFromAsyncAttr(UnavailableFromAsyncAttr *attr);
276+
277+
void visitPrimaryAssociatedTypeAttr(PrimaryAssociatedTypeAttr *attr);
276278
};
277279

278280
} // end anonymous namespace
@@ -5777,6 +5779,10 @@ void AttributeChecker::visitUnavailableFromAsyncAttr(
57775779
}
57785780
}
57795781

5782+
void AttributeChecker::visitPrimaryAssociatedTypeAttr(
5783+
PrimaryAssociatedTypeAttr *attr) {
5784+
}
5785+
57805786
namespace {
57815787

57825788
class ClosureAttributeChecker

lib/Sema/TypeCheckDeclOverride.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,9 @@ namespace {
15641564

15651565
UNINTERESTING_ATTR(TypeSequence)
15661566
UNINTERESTING_ATTR(CompileTimeConst)
1567+
1568+
UNINTERESTING_ATTR(PrimaryAssociatedType)
1569+
15671570
#undef UNINTERESTING_ATTR
15681571

15691572
void visitAvailableAttr(AvailableAttr *attr) {

0 commit comments

Comments
 (0)