Revert "Update: propEq to allow wider-typing for value in comparison"#99
Uh oh!
There was an error while loading. Please reload this page.
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.
Reverts #74
@Nemo108 In my MR out on , this comment pointed out a test that I had commented out. I had the intention of coming back to, but forgot (human error).
That test is this:
You get an error on
isBuybeing passed toR.filter:Expand to see error
``` No overload matches this call. Overload 1 of 5, '(pred: (val:{type: string}) => val is{type: string}, list: readonly{type: string}[]):{type: string}[]', gave the following error. Argument of type '>>(obj: Required extends Record<"type", any> ? string extends WidenLiterals ? U : never : never) => boolean' is not assignable to parameter of type '(val:{type: string}) => val is{type: string}'. Signature '(obj:{type: string}): boolean' must be a type predicate. Overload 2 of 5, '(pred: (val: unknown) => val is unknown, dict: Record): Record', gave the following error. Argument of type '>>(obj: Required extends Record<"type", any> ? string extends WidenLiterals ? U : never : never) => boolean' is not assignable to parameter of type '(val: unknown) => val is unknown'. Types of parameters 'obj' and 'val' are incompatible. Type 'unknown' is not assignable to type 'Partial>'. Overload 3 of 5, '(pred: (value: unknown) => boolean, collection:{type: string}[]):{type: string}[]', gave the following error. Argument of type '>>(obj: Required extends Record<"type", any> ? string extends WidenLiterals ? U : never : never) => boolean' is not assignable to parameter of type '(value: unknown) => boolean'. Types of parameters 'obj' and 'value' are incompatible. Type 'unknown' is not assignable to type 'Partial>'.ts(2769) ```I'm pretty sure it's because of how we have the turnary and the
: never. The fact that that function's first argument could be the bottom typenever, it will never be compatible withR.filter()or any function that is looking for a a function predicate such at that.This means that #74 breaks existing behavior in a net-negative way. While it did solve a lot of the defined issues called out, I can't keep this as is.
This sucks, a lot. But I must revert it. I can't move forward if it's going to break consumer's existing code negatively like this.