Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CsWinRT doesn't generate code for IMapChangedEventArgs #1631

Closed
hez2010 opened this issue Jun 5, 2024 · 0 comments
Closed

CsWinRT doesn't generate code for IMapChangedEventArgs #1631

hez2010 opened this issue Jun 5, 2024 · 0 comments
Labels
AOT bug Something isn't working
Milestone

Comments

@hez2010
Copy link
Contributor

hez2010 commented Jun 5, 2024

The below code make CsWinRT produce invalid code:

public partial class ObservableDictionaryChangedEventArgs : IMapChangedEventArgs<string>
{
    public ObservableDictionaryChangedEventArgs(CollectionChange change, string key)
    {
        this.CollectionChange = change;
        this.Key = key;
    }

    public CollectionChange CollectionChange { get; private set; }
    public string Key { get; private set; }
}

where CsWinRT generates code for ObservableDictionaryChangedEventArgs :

using static WinRT.TypeExtensions;

namespace App1
{
[global::WinRT.WinRTRuntimeClassName("Windows.Foundation.Collections.IMapChangedEventArgs`1<String>")]
[global::WinRT.WinRTExposedType(typeof(ObservableDictionaryChangedEventArgsWinRTTypeDetails))]
partial class ObservableDictionaryChangedEventArgs
{
}

internal sealed class ObservableDictionaryChangedEventArgsWinRTTypeDetails : global::WinRT.IWinRTExposedTypeDetails
{
    public global::System.Runtime.InteropServices.ComWrappers.ComInterfaceEntry[] GetExposedInterfaces()
    {
        _ = global::WinRT.GenericHelpers.IMapChangedEventArgs_string.Initialized;

        return new global::System.Runtime.InteropServices.ComWrappers.ComInterfaceEntry[]
        {
            new global::System.Runtime.InteropServices.ComWrappers.ComInterfaceEntry
            {
                IID = global::ABI.Windows.Foundation.Collections.IMapChangedEventArgsMethods<string>.IID,
                Vtable = global::ABI.Windows.Foundation.Collections.IMapChangedEventArgsMethods<string>.AbiToProjectionVftablePtr
            },
};
        }
    }
}

but there's no IMapChangedEventArgs_string being generated.

Version used: CsWinRT 2.1.0-prerelease.240602.1

@hez2010 hez2010 added the bug Something isn't working label Jun 5, 2024
@manodasanW manodasanW added the AOT label Jun 5, 2024
@manodasanW manodasanW added this to the Release 2.1 milestone Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AOT bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants