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

Mark methods/properties that return WinRT objects as nullable #650

Merged
merged 8 commits into from
Jan 6, 2023

Conversation

halildurmus
Copy link
Owner

@halildurmus halildurmus commented Jan 6, 2023

Fixes #647

Note that we must also mark WinRT object parameters as nullable.

IStorageItemExtraProperties.RetrievePropertiesAsync(IIterable) Method's parameter can take null:

A collection that contains the names of the properties to retrieve. Pass null to retrieve all possible properties.

I'm thinking of doing that after we land this.

@halildurmus halildurmus changed the title Methods/properties that return WinRT objects as nullable Mark methods/properties that return WinRT objects as nullable Jan 6, 2023
@halildurmus halildurmus marked this pull request as ready for review January 6, 2023 17:03
Copy link
Contributor

@timsneath timsneath left a comment

Choose a reason for hiding this comment

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

Approved with clenched teeth :) Here's hoping that in the future WinRT adds null safety.

@halildurmus
Copy link
Owner Author

Approved with clenched teeth :)

Thanks!

Here's hoping that in the future WinRT adds null safety.

There was a proposal to introduce a NotNull attribute to the WinMD for this but apparently, they decided not to go with it (see microsoft/xlang#708) :(.

@halildurmus halildurmus merged commit c38cd5a into main Jan 6, 2023
@halildurmus halildurmus deleted the nullable branch January 6, 2023 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Methods/properties that return WinRT objects should be nullable
2 participants