Skip to content

Commit

Permalink
Fix IStringable to implement IInspectable. (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlabelle authored Mar 24, 2024
1 parent c7c8cd5 commit 64bd9c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Support/Sources/WindowsRuntime/WinRTExport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fileprivate final class WinRTWrappingExport<Projection: COMTwoWayProjection>: CO
}
}

fileprivate class Stringable: COMExport<WindowsFoundation_IStringableProjection>, WindowsFoundation_IStringableProtocol {
fileprivate class Stringable: WinRTExport<WindowsFoundation_IStringableProjection>, WindowsFoundation_IStringableProtocol {
private let target: any CustomStringConvertible
init(target: any CustomStringConvertible) { self.target = target }
func toString() throws -> String { target.description }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import WindowsRuntime_ABI

public typealias WindowsFoundation_IStringable = any WindowsFoundation_IStringableProtocol
public protocol WindowsFoundation_IStringableProtocol: IUnknownProtocol {
public protocol WindowsFoundation_IStringableProtocol: IInspectableProtocol {
func toString() throws -> String
}

public enum WindowsFoundation_IStringableProjection: COMTwoWayProjection {
public enum WindowsFoundation_IStringableProjection: WinRTTwoWayProjection {
public typealias SwiftObject = WindowsFoundation_IStringable
public typealias COMInterface = WindowsRuntime_ABI.SWRT_WindowsFoundation_IStringable
public typealias COMVirtualTable = WindowsRuntime_ABI.SWRT_WindowsFoundation_IStringableVTable

public static var interfaceID: COMInterfaceID { COMInterface.iid }
public static var runtimeClassName: String { "Windows.Foundation.IStringable" }
public static var virtualTablePointer: COMVirtualTablePointer { withUnsafePointer(to: &virtualTable) { $0 } }

public static func toSwift(_ reference: consuming COMReference<COMInterface>) -> SwiftObject {
Expand All @@ -21,7 +22,7 @@ public enum WindowsFoundation_IStringableProjection: COMTwoWayProjection {
try Import.toCOM(object)
}

private final class Import: COMImport<WindowsFoundation_IStringableProjection>, WindowsFoundation_IStringableProtocol {
private final class Import: WinRTImport<WindowsFoundation_IStringableProjection>, WindowsFoundation_IStringableProtocol {
public func toString() throws -> String {
try _interop.toString()
}
Expand Down

0 comments on commit 64bd9c2

Please sign in to comment.