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 @@ -768,6 +768,9 @@ struct BridgedDeclAttributes {
768
768
BRIDGED_INLINE swift::DeclAttributes unbridged () const ;
769
769
};
770
770
771
+ SWIFT_NAME (" BridgedDeclAttribute.isDeclModifier(_:)" )
772
+ bool BridgedDeclAttribute_isDeclModifier(BridgedDeclAttrKind cKind);
773
+
771
774
SWIFT_NAME (" BridgedDeclAttributes.add(self:_:)" )
772
775
void BridgedDeclAttributes_add(BridgedDeclAttributes *_Nonnull attrs,
773
776
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 @@ -1971,9 +1971,12 @@ extension ASTGenVisitor {
1971
1971
// Other modifiers are all "simple" attributes.
1972
1972
let kind = BridgedDeclAttrKind ( from: node. name. rawText. bridged)
1973
1973
guard kind != . none else {
1974
- // TODO: Diagnose?
1975
- assertionFailure ( " unknown decl modifier " )
1976
- return nil
1974
+ // TODO: Diagnose.
1975
+ fatalError ( " (compiler bug) unknown decl modifier " )
1976
+ }
1977
+ if !BridgedDeclAttribute. isDeclModifier ( kind) {
1978
+ // TODO: Diagnose.
1979
+ fatalError ( " (compiler bug) decl attribute was parsed as a modifier " )
1977
1980
}
1978
1981
return self . generateSimpleDeclAttr ( declModifier: node, kind: kind)
1979
1982
}
You can’t perform that action at this time.
0 commit comments