Skip to content

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

Merged
merged 12 commits into from
Oct 10, 2022
Merged

3.4.1 Release #78

merged 12 commits into from
Oct 10, 2022

Conversation

nblumhardt
Copy link
Member

@nblumhardt nblumhardt commented Sep 14, 2022


public class TestHelperNameResolver: NameResolver
{
public override bool TryResolveFunctionName(string name, [MaybeNullWhen(false)] out MethodInfo implementation)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public override bool TryResolveFunctionName(string name, [MaybeNullWhen(false)] out MethodInfo implementation)
public override bool TryResolveFunctionName(string name, [NotNullWhen(true)] out MethodInfo? implementation)

Copy link
Member Author

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

Copy link

@AraHaan AraHaan Sep 17, 2022

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.

Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Great point! Thanks 👍

Copy link
Member Author

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 :)

SimonCropp and others added 6 commits September 17, 2022 21:36
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>
@nblumhardt nblumhardt merged commit 25c6509 into main Oct 10, 2022
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.

6 participants