Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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
9 changes: 9 additions & 0 deletions 9 strings/base_implements.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,15 @@ namespace winrt::impl
}
};

template <>
struct runtime_class_name<Windows::Foundation::IInspectable>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that name_of still returns Object, which is necessary for proper autogeneration of parameterized interfaces.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's kinda important. 😉

{
static hstring get()
{
return {};
}
};

template <typename D, typename I, typename Enable>
struct producer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TEST_CASE("Test_GetRuntimeClassName_NoOverride")
{
Windows::Foundation::IInspectable i = make<Test_GetRuntimeClassName_NoOverride>();

REQUIRE(get_class_name(i) == L"Object");
REQUIRE(get_class_name(i) == L"");
}

TEST_CASE("Test_GetRuntimeClassName_Override")
Expand Down
1 change: 1 addition & 0 deletions 1 test/old_tests/UnitTests/constexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ TEST_CASE("constexpr")
REQUIRE(winrt::guid_of<winrt::IInspectable>() == winrt::guid(__uuidof(::IInspectable)));
REQUIRE(winrt::guid_of<winrt_container>() == winrt::guid(__uuidof(midl_container)));
REQUIRE(winrt::name_of<winrt::IInspectable>() == L"Object"sv);
REQUIRE(winrt::name_of<winrt::IAsyncOperation<winrt::IInspectable>>() == L"Windows.Foundation.IAsyncOperation`1<Object>"sv);

REQUIRE(winrt::name_of<winrt_container>() == midl_container::z_get_rc_name_impl());

Expand Down
2 changes: 1 addition & 1 deletion 2 test/old_tests/UnitTests/produce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct produce_IInspectable_RuntimeClassName : implements<produce_IInspectable_R
TEST_CASE("produce_IInspectable_RuntimeClassName")
{
Windows::Foundation::IInspectable without = make<produce_IInspectable_No_RuntimeClassName>();
REQUIRE(get_class_name(without) == L"Object");
REQUIRE(get_class_name(without) == L"");

Windows::Foundation::IInspectable with = make<produce_IInspectable_RuntimeClassName>();
REQUIRE(get_class_name(with) == L"produce_IInspectable_RuntimeClassName");
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.