microsoft / microsoft/cppwinrt
Bug: Cannot winrt::box_value a wchar_t
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 281
- PR merge metrics
- No merged PRs in 30d
Description
Version
No response
Summary
From this documentation, it should be able to expose a Char type from the idl, but doing this will cause a compile error:
static_assert(impl::has_category_v<T>, "T must be WinRT type.");
Reproducible example
Use this idl
[default_interface]
runtimeclass MainPage : Windows.UI.Xaml.Controls.Page
{
MainPage();
Char MyProperty;
}
Expected behavior
Compiles
Actual behavior
No response
Additional comments
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by compiling the provided IDL with the Char property and trace the generated C++/WinRT code into winrt::box_value and the has_category assertion. Compare Char handling with other supported IDL types; done means the reproducible example compiles and the Char property can be exposed without the static assertion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100