mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SymbolGraph] Put extending declarations in rootmost module
When extending another module's type in your module, serialize declarations in the extension into the other module's "extension" symbol graph file, including relationships. This mechanic should continue up to the rootmost module. For example: A.AStruct <- B.BStruct < C.CStruct Both BStruct and CStruct should go in `@A` symbol graph files because AStruct owns BStruct and by extension owns CStruct. This is reflected in documentation curation in some form already. rdar://60796811
This commit is contained in:
18
test/SymbolGraph/Module/Inputs/NestedExtensions/C.swift
Normal file
18
test/SymbolGraph/Module/Inputs/NestedExtensions/C.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
import A
|
||||
import B
|
||||
|
||||
extension AStruct.BStruct {
|
||||
public struct CStruct: P {
|
||||
public func foo() -> UInt8 {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension AStruct.BStruct {
|
||||
public func baz() {}
|
||||
}
|
||||
|
||||
extension AStruct.BStruct.CStruct where Thing: Equatable {
|
||||
public func baz() {}
|
||||
}
|
||||
Reference in New Issue
Block a user