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 {
777
777
BRIDGED_INLINE swift::DeclAttributes unbridged () const ;
778
778
};
779
779
780
+ SWIFT_NAME (" BridgedDeclAttribute.isDeclModifier(_:)" )
781
+ bool BridgedDeclAttribute_isDeclModifier(BridgedDeclAttrKind cKind);
782
+
780
783
SWIFT_NAME (" BridgedDeclAttributes.add(self:_:)" )
781
784
void BridgedDeclAttributes_add(BridgedDeclAttributes *_Nonnull attrs,
782
785
BridgedDeclAttribute add);
Original file line number Diff line number Diff line change @@ -66,6 +66,13 @@ BridgedDeclAttribute BridgedDeclAttribute_createSimple(
66
66
cAtLoc.unbridged (), cAttrLoc.unbridged ());
67
67
}
68
68
69
+ bool BridgedDeclAttribute_isDeclModifier (BridgedDeclAttrKind cKind) {
70
+ auto optKind = unbridged (cKind);
71
+ if (!optKind)
72
+ return false ;
73
+ return DeclAttribute::isDeclModifier (*optKind);
74
+ }
75
+
69
76
void BridgedDeclAttributes_add (BridgedDeclAttributes *cAttrs,
70
77
BridgedDeclAttribute cAdd) {
71
78
auto attrs = cAttrs->unbridged ();
Original file line number Diff line number Diff line change @@ -1973,9 +1973,12 @@ extension ASTGenVisitor {
1973
1973
// Other modifiers are all "simple" attributes.
1974
1974
let kind = BridgedDeclAttrKind ( from: node. name. rawText. bridged)
1975
1975
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 " )
1979
1982
}
1980
1983
return self . generateSimpleDeclAttr ( declModifier: node, kind: kind)
1981
1984
}
You can’t perform that action at this time.
0 commit comments