Skip to content
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

FillForward bug when filler is null #999

Closed
viceroypenguin opened this issue May 5, 2023 · 1 comment · Fixed by #1006
Closed

FillForward bug when filler is null #999

viceroypenguin opened this issue May 5, 2023 · 1 comment · Fixed by #1006
Labels
Milestone

Comments

@viceroypenguin
Copy link
Contributor

There is a slight bug in FillForward; though it is very obscure and unlikely to be relevant to most users.

Consider the following code:

var result = new int?[] { null, 200, null, }
	.FillForward(x => x == 200);

// expected
result == [ null, null, null ]

// actual
result == [ null, 200, null ]

The first value of null is not blank (null != 200); the second value is blank (200 == 200). Per the expectations of FillForward, the existing value of null should be carried forward to replace the 200 value. However, is (true, { } someSeed) rejects a null value, even if true, so we get the value of 200.

Related: viceroypenguin/SuperLinq#372

@atifaziz
Copy link
Member

atifaziz commented May 6, 2023

This is indeed super obscure and probably doesn't make practical sense, but it's a bug nonetheless so thanks for reporting it.

@atifaziz atifaziz added the bug label May 6, 2023
@atifaziz atifaziz changed the title FillForward bug FillForward bug when filler is null May 6, 2023
@atifaziz atifaziz added this to the 4.0 milestone Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants