You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a C# feature that if you have [Optional] on parameters that callers can omit those parameters and the compiler will automatically pass default for those parameters. This is almost like providing = default values on the parameters except that it also works for any parameter, not just trailing parameters.
What this means is that we can put [Optional] on any parameter that is optional which doesn't also have an out or ref modifier on it, and that will give callers a little more flexibility and communicate which parameters are optional / can be omitted.
Can you please also add test for FwpmEngineOpen0? As per microsoft/win32metadata#2153 the first parameter in native overload didn't have [Optional] on it. It is not tagged [Reserved], but the native overload still lacks [Optional] attribute. This is either already fixed with your changes or needs some additional tweaks. Either way, it is a good test case verifying that a combination of [Reserved] and [Optional] still puts [Optional] in the native overload
I meant a test for the native overload. It is a good thing that this parameter is omitted from the friendly one, but the native should still have this parameter as [Optional], so it can be skipped when using named argiments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a C# feature that if you have
[Optional]on parameters that callers can omit those parameters and the compiler will automatically passdefaultfor those parameters. This is almost like providing= defaultvalues on the parameters except that it also works for any parameter, not just trailing parameters.What this means is that we can put
[Optional]on any parameter that is optional which doesn't also have anoutorrefmodifier on it, and that will give callers a little more flexibility and communicate which parameters are optional / can be omitted.Fixes #1580 , Fixes #652