Skip to content

Enable Nullability on a couple of Interfaces#8394

Merged
lonitra merged 1 commit intodotnet:mainfrom
elachlan:Nullability-2
Dec 21, 2022
Merged

Enable Nullability on a couple of Interfaces#8394
lonitra merged 1 commit intodotnet:mainfrom
elachlan:Nullability-2

Conversation

@elachlan
Copy link
Contributor

@elachlan elachlan commented Dec 15, 2022

Enable Nullability on a couple of Interfaces

Related: #8342

Microsoft Reviewers: Open in CodeFlow

@elachlan elachlan requested a review from a team as a code owner December 15, 2022 22:41
@ghost ghost assigned elachlan Dec 15, 2022
Copy link
Member

@lonitra lonitra left a comment

Choose a reason for hiding this comment

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

Just a question, but otherwise LGTM

Comment on lines +462 to +464
System.Resources.Tools.ITargetAwareCodeDomProvider.SupportsProperty(System.Type! type, string! propertyName, bool isWritable) -> bool
System.Runtime.InteropServices.UCOMITypeLib.GetDocumentation(int index, out string! strName, out string! strDocString, out int dwHelpContext, out string! strHelpFile) -> void
System.Runtime.InteropServices.UCOMITypeLib.IsName(string! szNameBuf, int lHashVal) -> bool
Copy link
Member

Choose a reason for hiding this comment

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

Curious, how did you verify that these should be nonnull?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the ITypeLib it should in-fact allow null. So I am wrong here.

Copy link
Contributor Author

@elachlan elachlan Dec 19, 2022

Choose a reason for hiding this comment

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

If the caller does not need the item name, then pBstrName can be null. So this would be true if we were using it as a standard pinvoke. We could pass null for the pointer value if we didn't want to get the strName. But since this interface has out parameters we aren't providing a pointer to a string. So it will always return the string value.

Does that make sense?

Copy link
Member

Choose a reason for hiding this comment

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

I see what you're saying, yep makes sense. Thanks for taking some time to look into that.

@lonitra lonitra added waiting-author-feedback The team requires more information from the author ready-to-merge PRs that are ready to merge but worth notifying the internal team. labels Dec 19, 2022
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Dec 19, 2022
Copy link
Member

@lonitra lonitra left a comment

Choose a reason for hiding this comment

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

🚀

@lonitra lonitra enabled auto-merge (squash) December 21, 2022 16:45
@lonitra lonitra merged commit 202011f into dotnet:main Dec 21, 2022
@ghost ghost added this to the 8.0 Preview1 milestone Dec 21, 2022
@elachlan elachlan deleted the Nullability-2 branch December 21, 2022 21:12
@ghost ghost locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-to-merge PRs that are ready to merge but worth notifying the internal team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants