File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Sources/SymbolGraphCompiler/Declarations Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -92,21 +92,27 @@ extension SSGC.DeclObject
92
92
}
93
93
94
94
// Only (Objective) C declarations can have multiple lexical scopes.
95
+ // https://github.com/swiftlang/swift/blob/main/docs/ABI/Mangling.rst
95
96
switch self . scopes. first
96
97
{
97
98
case scope? :
98
99
break
99
100
100
101
case let existing? :
101
- if case . s = self . id. language
102
+ guard case . s = self . id. language
103
+ else
102
104
{
103
- throw SSGC . LexicalScopeError . multiple ( existing , scope )
105
+ fallthrough
104
106
}
105
- else
107
+
108
+ let suffix : Substring = self . id. suffix
109
+ if suffix. starts ( with: " SC " ) || suffix. starts ( with: " So " )
106
110
{
107
111
fallthrough
108
112
}
109
113
114
+ throw SSGC . LexicalScopeError. multiple ( existing, scope)
115
+
110
116
case nil :
111
117
self . scopes. insert ( scope)
112
118
}
You can’t perform that action at this time.
0 commit comments