tristanlabelle / swift-winrt

A Swift Projection for WinRT APIs
MIT License
20 stars 2 forks source link

Missing transitive base interface members on binding `Import` classes #343

Closed tristanlabelle closed 1 month ago

tristanlabelle commented 1 month ago

Seen with IObservableMap, where the binding's Import class did not provide a definition for first, which comes from IIterable transitively through IMap.

error: type 'WindowsFoundationCollections_IObservableMapBinding.String_Object.Import' does not conform to protocol 'WindowsFoundationCollections_IIterableProtocol'

25 |         }
26 |
27 |         private final class Import: WinRTImport<String_Object>, WindowsFoundationCollections_IObservableMapProtocol {
|                             `- error: type 'WindowsFoundationCollections_IObservableMapBinding.String_Object.Import' does not conform to protocol 'WindowsFoundationCollections_IIterableProtocol'
28 |             public typealias K = Swift.String
29 |             public typealias V = WindowsRuntime.IInspectable?

note: protocol requires function 'first()' with type '() throws -> WindowsFoundationCollections_IIterator' (aka '() throws -> any WindowsFoundationCollections_IIteratorProtocol')

14 |     /// Returns an iterator for the items in the collection.
15 |     /// - Returns: The iterator.
16 |     func first() throws -> WindowsFoundationCollections_IIterator<T>
|          `- note: protocol requires function 'first()' with type '() throws -> WindowsFoundationCollections_IIterator<Self.T>' (aka '() throws -> any WindowsFoundationCollections_IIteratorProtocol<Self.T>')
17 | }
tristanlabelle commented 1 month ago

This happens specifically with IObservableVector and IObservableMap, which do not declare their transitive IIterable base as a direct base (whereas other derived interfaces do).