Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cppwinrt/component_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,16 +498,18 @@ catch (...) { return winrt::to_hresult(); }
{
auto format = R"( % %::%(%)
{
return @::implementation::%::%(%);
%@::implementation::%::%(%);
}
)";

bool ignore_return = is_put_overload(method) || !signature.return_signature();

w.write(format,
signature.return_signature(),
type_name,
method_name,
bind<write_consume_params>(signature),
ignore_return ? "" : "return ",
type_namespace,
type_name,
method_name,
Expand Down
16 changes: 16 additions & 0 deletions test/test_component/Class.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ namespace winrt::test_component::implementation
Windows::Foundation::IAsyncOperation<int> RaiseDeferrableEventAsync();

static bool TestNoMakeDetection();

static int32_t StaticPropertyWithAsyncSetter()
{
return 0;
}

static fire_and_forget StaticPropertyWithAsyncSetter(int32_t)
{
co_return;
}

static fire_and_forget StaticMethodWithAsyncReturn()
{
co_return;
}

private:

bool m_fail{};
Expand Down
2 changes: 2 additions & 0 deletions test/test_component/test_component.idl
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ namespace test_component
Windows.Foundation.IAsyncOperation<Int32> RaiseDeferrableEventAsync();

static Boolean TestNoMakeDetection();
static Int32 StaticPropertyWithAsyncSetter;
static void StaticMethodWithAsyncReturn();
}

namespace Structs
Expand Down