You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I've shared the exact code with the C#/WinRT team in private, but I'm not putting it here due to it being internal Microsoft code.)
I'm getting an error like this:
error: 'Could not find property getter interface' when processing MyNamespace.IDataSink
When cswinrt.exe sees IDataSink, it notices there is a setter without a getter, so it calls find_property_interface to find the interface that the getter is implemented on.
auto [getter, setter] = get_property_methods(prop);
// "new" required if overriding a getter in a base interface
auto new_keyword = (!getter && setter && find_property_interface(w, type, prop.Name()).second) ? "new " : "";
However, in find_property_interface, it doesn’t find the getter interface for this case. The InterfaceImpl method returns an empty collection for the setter interface and the get_attribute block is not entered, so find_property_interface reaches its throw statement.
Steps To Reproduce
Use the pattern I shared above and try to generate interop code using cswinrt.exe. I have shared the winmds and a repro command line with the C#/WinRT devs through email.
Expected Behavior
cswinrt.exe should successfully generate interop code for this runtime class and its interfaces.
Version Info
This reproduces with the latest version of C#/WinRT. I tested with 2.1.1 and a newer version as well.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Description
I'm using C#/WinRT on a type where the IDL looks something like this:
(I've shared the exact code with the C#/WinRT team in private, but I'm not putting it here due to it being internal Microsoft code.)
I'm getting an error like this:
error: 'Could not find property getter interface' when processing MyNamespace.IDataSink
When cswinrt.exe sees IDataSink, it notices there is a setter without a getter, so it calls find_property_interface to find the interface that the getter is implemented on.
However, in find_property_interface, it doesn’t find the getter interface for this case. The InterfaceImpl method returns an empty collection for the setter interface and the get_attribute block is not entered, so find_property_interface reaches its throw statement.
Steps To Reproduce
Use the pattern I shared above and try to generate interop code using cswinrt.exe. I have shared the winmds and a repro command line with the C#/WinRT devs through email.
Expected Behavior
cswinrt.exe should successfully generate interop code for this runtime class and its interfaces.
Version Info
This reproduces with the latest version of C#/WinRT. I tested with 2.1.1 and a newer version as well.
Additional Context
No response
The text was updated successfully, but these errors were encountered: