We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 665d3e1 commit fd025abCopy full SHA for fd025ab
lib/ClangImporter/ImportDecl.cpp
@@ -429,8 +429,13 @@ void ClangImporter::Implementation::addSynthesizedProtocolAttrs(
429
auto &ctx = nominal->getASTContext();
430
431
for (auto kind : synthesizedProtocolAttrs) {
432
- nominal->getAttrs().add(
433
- new (ctx) SynthesizedProtocolAttr(ctx.getProtocol(kind), this, isUnchecked));
+ // This is unfortunately not an error because some test use mock protocols.
+ // If those tests were updated, we could assert that
434
+ // ctx.getProtocol(kind) != nulltpr which would be nice.
435
+ if (auto proto = ctx.getProtocol(kind))
436
+ nominal->getAttrs().add(
437
+ new (ctx) SynthesizedProtocolAttr(ctx.getProtocol(kind), this,
438
+ isUnchecked));
439
}
440
441
0 commit comments