Skip to content

Commit ac9071e

Browse files
committed
SwiftExtract: include URL in the Foundation known-module overlay
The Foundation/FoundationEssentials known-module source files declared Data, Date, and UUID, but URL was missing — so any user code using URL (e.g. `func getHost(url: URL)`) failed to import with an unresolved-type warning, dropping the function silently. swift-python relies on URL for its bridging tests; add it alongside the other Foundation built-ins, declaring just the failable `init(string:)` and `absoluteString` property the language-neutral analyzer needs to resolve uses.
1 parent 09cee5b commit ac9071e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Sources/SwiftExtract/SwiftTypes/SwiftKnownModules.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ private let foundationEssentialsSourceFile: SourceFileSyntax = """
130130
}
131131
132132
public struct UUID {}
133+
134+
public struct URL {
135+
public init?(string: String)
136+
public var absoluteString: String { get }
137+
}
133138
"""
134139

135140
private var foundationSourceFile: SourceFileSyntax {

0 commit comments

Comments
 (0)