halildurmus / dartwinrt

Idiomatic Dart projection of the modern Windows Runtime (WinRT) APIs.
BSD 3-Clause "New" or "Revised" License
49 stars 3 forks source link

Cast objects to appropriate interfaces on `IIterable` parameters #93

Closed halildurmus closed 1 year ago

halildurmus commented 1 year ago

Description

WinRT APIs that take IIterable as a parameter often expect the IIterable objects directly. This means if we pass objects like IVector and IMap to these APIs, we would get an Exception.

This PR, cast objects to appropriate IIterable interfaces on IIterable parameters to fix this. Ideally, we should expose IIterable parameters as List or Map depending on the type argument. However, in order to do that, we have to implement collection interfaces first.

Related Issue

Type of Change