Fix TargetInvocationException with non nullable value types with HasConversion - #3920
Open
henriquewr wants to merge 1 commit into
Open
henriquewr wants to merge 1 commit into
henriquewr wants to merge 1 commit into
Conversation
henriquewr
commented
Sep 23, 2026
|
|
||
| SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" | ||
| FROM "PrimitiveCollectionsEntity" AS p | ||
| WHERE NOT (p."NullableWrappedId" = ANY (@values) AND p."NullableWrappedId" = ANY (@values) IS NOT NULL) AND (p."NullableWrappedId" IS NOT NULL OR array_position(@values, NULL) IS NULL) |
Contributor
Author
There was a problem hiding this comment.
Shouldn't it be NullableWrappedIdWithNullableComparer in the WHERE clause?
base test:
[Fact] // Issue #35117
public virtual async Task Parameter_collection_of_structs_Contains_nullable_struct_with_nullable_comparer()
{
var values = new List<WrappedId> { new(22), new(33) };
await AssertQuery(
ss => ss.Set<PrimitiveCollectionsEntity>().Where(c => values.Contains(c.NullableWrappedIdWithNullableComparer!.Value)),
ss => ss.Set<PrimitiveCollectionsEntity>().Where(c
=> c.NullableWrappedIdWithNullableComparer != null && values.Contains(c.NullableWrappedIdWithNullableComparer.Value)));
values = [new(11), new(44)];
await AssertQuery(
ss => ss.Set<PrimitiveCollectionsEntity>().Where(c => !values.Contains(/*Here*/c.NullableWrappedId!.Value)),
ss => ss.Set<PrimitiveCollectionsEntity>().Where(c
=> c.NullableWrappedIdWithNullableComparer == null || !values.Contains(c.NullableWrappedIdWithNullableComparer!.Value)));
}This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #3919
I'm almost 100% certain that this also fixes #3716
seems to be the same stack trace