-
Notifications
You must be signed in to change notification settings - Fork 17
3.4.1 Release #78
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
3.4.1 Release #78
Conversation
Add test cases to cover object accessor wildcards
|
||
public class TestHelperNameResolver: NameResolver | ||
{ | ||
public override bool TryResolveFunctionName(string name, [MaybeNullWhen(false)] out MethodInfo implementation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public override bool TryResolveFunctionName(string name, [MaybeNullWhen(false)] out MethodInfo implementation) | |
public override bool TryResolveFunctionName(string name, [NotNullWhen(true)] out MethodInfo? implementation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - agreed, but actually needs a major version bump to work, I think (I tried earlier :-)) so may have to wait for a follow-up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think changing the attribute would be breaking at all though, same with changing from non-nullable to nullable.
Plus it is in tests so I do not think people outside of the repository would use it anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but actually needs a major version bump to work
why?
note that nullable ref types is implemented using attributes. so it is not a runtime breaking change.
here is what it actually compiles to
public override bool TryResolveFunctionName(string name, [System.Runtime.CompilerServices.Nullable(2)][NotNullWhen(true)] out MethodInfo implementation)
{
NameResolver[] orderedResolvers = _orderedResolvers;
foreach (NameResolver resolver in orderedResolvers)
{
if (resolver.TryResolveFunctionName(name, out implementation))
{
return true;
}
}
implementation = null;
return false;
}
Arguably someone could be using the nullable implementation
parameter without null checking it (or not inside an iff on the returned bool). but in that case we want it to break for them, since they have a bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point! Thanks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just catching up now after a couple of weeks away - I'll leave this for the next round of changes so we can keep things moving here in the meantime :)
file scoped namespace and target typed new
from net5.0 to net.6.0 net5.0 has reached EOL
step sample project target framework from net5.0 to net.6.0
…adme Add a recipie for checking if an object is empty
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>
new
(@SimonCropp)