Skip to content

Microsoft.UI.Xaml.Interop.IBindableIterable and IBindableIterator should derive from IIterable<IInspectable> and IIterator<IInspectable> respectively #7891

@sylveon

Description

@sylveon

Describe the bug

Currently, these two types do not derive from IIterable/IIterator, which makes support in projections more complex than it needs to be (need to special case these types, duplicating already existing code). Notably, it means that in cppwinrt you can't use .begin() and .end(), C++20 ranges, or a for loop over IBindableIterable because this is only implemented for IIterable. C++/WinRT is trying to avoid special casing code for third parties, so a fix on the cppwinrt side is not happening. Meanwhile CsWinRT just projects it as IEnumerable, lol.

By making the interface derive from IIterable, it means cppwinrt's collections support automatically lights up, and it can be treated as just another type by most projections (cswinrt could drop its special casing to project it as IEnumerable as well).

Steps to reproduce the bug

N/A

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.2 Preview 1: 1.2.0-preview1

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

Windows 11 (22H2): Build 22621

Additional context

This will probably require an ABI break.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions