File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
Sources/SymbolGraphCompiler Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -450,7 +450,37 @@ extension SSGC.TypeChecker
450
450
""" )
451
451
}
452
452
guard
453
- let conformance: Symbol . Decl = feature. scopes. first, feature. scopes. count == 1
453
+ let conformance: Symbol . Decl = feature. scopes. first
454
+ else
455
+ {
456
+ // We hit this on an extremely unusual edge case where a feature and an heir
457
+ // are public, but the protocol the feature is defined on is not. Here is some
458
+ // valid Swift code that demonstrates this:
459
+ //
460
+ /* ```
461
+ protocol P
462
+ {
463
+ }
464
+ extension P
465
+ {
466
+ public
467
+ func f()
468
+ {
469
+ }
470
+ }
471
+
472
+ public
473
+ struct S:P
474
+ {
475
+ }
476
+ ```
477
+ */
478
+ // Ideally, lib/SymbolGraphGen would not emit the feature in this case, but
479
+ // it does anyway.
480
+ return
481
+ }
482
+
483
+ guard feature. scopes. count == 1
454
484
else
455
485
{
456
486
throw AssertionError . init ( message: """
You can’t perform that action at this time.
0 commit comments