snarbles2
snarbles2
It's not a bug per se, and it's probably virtually impossible to come up with a solution that will accept any definition that can be construed as valid. That said,...
Ah, sorry. Reading comprehension fail.
> Is this only working at runtime due to coercion to string since `Location.toString()` gives a string? I can't see how `window.location = { ...anything }` should work, as that...
I assume `TypeParam` means a generic type parameter (``). If we restricted the comparison operators to a specific set of types, you could constraint your `T` to comparable types but...
> Also, I'm confused, I thought enums were not a native JavaScript type... wouldn't it just be a number/string/whatever the underlying type is? Typescript does not operate on underlying native...
The default generic argument is the wider option (``). It would be weird if `(arg: Uint8Array) => {}` couldn't accept all `Uint8Array`s. Probably don't want to change that, so strike...
Have you read the linked issues? There was much contention. Admittedly those discussions were quite a while ago and I think we'd be *closer* to a consensus that `T?` should...
> The contention was due to the fact that people expressed their opinions on what the T? should be in their mind. Well... yeah, that's how this works. And you...
> b) a union of 32766 members Would we not want to treat `1..5` as equivalent to `1 | 2 | 3 | 4 | 5`? It would be surprising...
Might as well ask why you can't just use an older version of typescript. You can. Either way, it's just a more complicated, less pleasant solution. I don't expect ES5...