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

Fixed regression in determining whether to provide IReference implementation, which dropped TimeSpan and a few other value types #770

Merged
merged 3 commits into from
Mar 16, 2021
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
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<CppWinRTVerbosity>high</CppWinRTVerbosity>
<CsWinRTVerbosity>high</CsWinRTVerbosity>
<!--Note: unlisted at https://www.nuget.org/packages/Microsoft.WinUI/-->
<MicrosoftWinUIVersion>3.0.0-preview3.201113.0</MicrosoftWinUIVersion>
<MicrosoftWinUIVersion>3.0.0-preview4.210210.4</MicrosoftWinUIVersion>
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<LangVersion>preview</LangVersion>
Expand Down
5 changes: 3 additions & 2 deletions src/WinRT.Runtime/ComWrappersSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,13 @@ private static bool ShouldProvideIReference(Type type)
{
static bool IsWindowsRuntimeType(Type type)
Copy link
Member

Choose a reason for hiding this comment

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

Does WinRT.Projections.IsTypeWindowsRuntimeType do the equivalent of this function?

{
if (type.GetCustomAttribute<WindowsRuntimeTypeAttribute>() is object)
if ((type.GetCustomAttribute<WindowsRuntimeTypeAttribute>() is object) ||
WinRT.Projections.IsTypeWindowsRuntimeType(type))
j0shuams marked this conversation as resolved.
Show resolved Hide resolved
return true;
type = type.GetAuthoringMetadataType();
if (type is object && type.GetCustomAttribute<WindowsRuntimeTypeAttribute>() is object)
return true;
return false;
return WinRT.Projections.IsTypeWindowsRuntimeType(type);
}

if (type == typeof(string) || type.IsTypeOfType())
Expand Down