Skip to content

Commit e8465bc

Browse files
committed
Use typed throws in some methods that only raise a single error
1 parent ac7eeae commit e8465bc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/SwiftDocC/Infrastructure/DocumentationContext.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2703,7 +2703,7 @@ public class DocumentationContext {
27032703
- Returns: A ``DocumentationNode`` with the given identifier.
27042704
- Throws: ``ContextError/notFound(_:)`` if a documentation node with the given identifier was not found.
27052705
*/
2706-
public func entity(with reference: ResolvedTopicReference) throws -> DocumentationNode {
2706+
public func entity(with reference: ResolvedTopicReference) throws(ContextError) -> DocumentationNode {
27072707
if let cached = documentationCache[reference] {
27082708
return cached
27092709
}

Sources/SwiftDocC/Semantics/Symbol/Symbol.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,14 @@ extension Symbol {
461461
/// When building multi-platform documentation symbols might have more than one declaration
462462
/// depending on variances in their implementation across platforms (e.g. use `NSPoint` vs `CGPoint` parameter in a method).
463463
/// This method finds matching symbols between graphs and merges their declarations in case there are differences.
464-
func mergeDeclaration(mergingDeclaration: SymbolGraph.Symbol.DeclarationFragments, identifier: String, symbolAvailability: SymbolGraph.Symbol.Availability?, alternateSymbols: SymbolGraph.Symbol.AlternateSymbols?, selector: UnifiedSymbolGraph.Selector) throws {
464+
func mergeDeclaration(mergingDeclaration: SymbolGraph.Symbol.DeclarationFragments, identifier: String, symbolAvailability: SymbolGraph.Symbol.Availability?, alternateSymbols: SymbolGraph.Symbol.AlternateSymbols?, selector: UnifiedSymbolGraph.Selector) throws(DocumentationContext.ContextError) {
465465
let trait = DocumentationDataVariantsTrait(for: selector)
466466
let platformName = selector.platform
467467

468468
func merge<Value: Equatable>(
469469
_ mergingValue: Value,
470470
into variants: inout DocumentationDataVariants<[[PlatformName?] : Value]>
471-
) throws {
471+
) throws(DocumentationContext.ContextError) {
472472
guard let platformName else {
473473
variants[trait]?[[nil]] = mergingValue
474474
return

0 commit comments

Comments
 (0)