You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type 'T' is not assignable to type 'Map<any, T[]>'.
Expected 0 type arguments, but got 1.
Property 'get' does not exist on type 'T'.
Property 'set' does not exist on type 'T'.
🙂 Expected behavior
Allowing the use of the 3rd overload method reduce<U> of Array / ReadonlyArray
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered:
There doesn't seem to be a reason to write Array | ReadonlyArray since that's equivalent to ReadonlyArray
true that, thanks for pointing that out. I initially wrote the function for Array<T> , then I had to modify it for ReadonlyArray and it ended up like that, but apparently unnecessarily
But I kind of thought #53489 took care of these "union of array" things.
This was released in TS 5.2 and it's only about fallback signatures. It applies to situations when a signature can be found in a normal way but we can see that TS was able to find some signatures here even before that: TS 5.1 playground.
This case loses the relevant signatures in (somewhat complicated) getUnionSignatures. This function is able to compute some signatures (2 to be precise) in this case though so the referenced improvement from TS 5.2 doesn't even kick-in.
🔎 Search Terms
overlaod union
🕗 Version & Regression Information
This changed between versions ______ and _______This changed in commit or PR _______I was unable to test this on prior versions because _______⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.7.0-dev.20240919#code/FAMwrgdgxgLglgewgAgOYCcFgA4CECeAPACoB8AFAIbrqX4BcyAgjXSaQD7IBKAppQBMkAG3wtaRMgBpkAa14NklCPgCUjALKVshZfhni2ZUsgDewZMnS8YYdCmoSAdNYFgovQlp16DrSaSB5FRQUDK8wrwAtrwQMKrIALwm5haWyFBIAM4wcknIMPjYvAggcgpJiYnIAOTg0PBINcgA-Mjk8vhKWe0R0bEwjMQJyUoqquR9MXEJjFMDANqd3eX4pcjEALoA3GmWkbkYWNj5lKFOqDYdqrvpyHBl5ACERzgJ5neWZ1BOWVeyMleJ2qC02Nz2yAAvhCgU5sGAsgALSaRabxW7pay2exKUK7NKQmQQXgAd2Q3l0Kj8EnYFFU4OhwCAA
💻 Code
🙁 Actual behavior
getting the errors:
Expected 0 type arguments, but got 1.
🙂 Expected behavior
Allowing the use of the 3rd overload method
reduce<U>
ofArray
/ReadonlyArray
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: