File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -777,6 +777,9 @@ struct BridgedDeclAttributes {
777777 BRIDGED_INLINE swift::DeclAttributes unbridged () const ;
778778};
779779
780+ SWIFT_NAME (" BridgedDeclAttribute.isDeclModifier(_:)" )
781+ bool BridgedDeclAttribute_isDeclModifier(BridgedDeclAttrKind cKind);
782+
780783SWIFT_NAME (" BridgedDeclAttributes.add(self:_:)" )
781784void BridgedDeclAttributes_add(BridgedDeclAttributes *_Nonnull attrs,
782785 BridgedDeclAttribute add);
Original file line number Diff line number Diff line change @@ -66,6 +66,13 @@ BridgedDeclAttribute BridgedDeclAttribute_createSimple(
6666 cAtLoc.unbridged (), cAttrLoc.unbridged ());
6767}
6868
69+ bool BridgedDeclAttribute_isDeclModifier (BridgedDeclAttrKind cKind) {
70+ auto optKind = unbridged (cKind);
71+ if (!optKind)
72+ return false ;
73+ return DeclAttribute::isDeclModifier (*optKind);
74+ }
75+
6976void BridgedDeclAttributes_add (BridgedDeclAttributes *cAttrs,
7077 BridgedDeclAttribute cAdd) {
7178 auto attrs = cAttrs->unbridged ();
Original file line number Diff line number Diff line change @@ -1973,9 +1973,12 @@ extension ASTGenVisitor {
19731973 // Other modifiers are all "simple" attributes.
19741974 let kind = BridgedDeclAttrKind ( from: node. name. rawText. bridged)
19751975 guard kind != . none else {
1976- // TODO: Diagnose?
1977- assertionFailure ( " unknown decl modifier " )
1978- return nil
1976+ // TODO: Diagnose.
1977+ fatalError ( " (compiler bug) unknown decl modifier " )
1978+ }
1979+ if !BridgedDeclAttribute. isDeclModifier ( kind) {
1980+ // TODO: Diagnose.
1981+ fatalError ( " (compiler bug) decl attribute was parsed as a modifier " )
19791982 }
19801983 return self . generateSimpleDeclAttr ( declModifier: node, kind: kind)
19811984 }
You can’t perform that action at this time.
0 commit comments