Denis Migdal

Results 36 comments of Denis Migdal

> This is working as intended, because method parameters are bivariant. That's why the "callback" version does result in an error. You can find more information here: https://github.com/microsoft/TypeScript/wiki/FAQ#why-are-function-parameters-bivariant Urg, that's...

> `{ readonly v: number }` can be passed to `{ v: number }` without issues. The `readonly` only applies to modifications via that interface. WTF. Why ??? That's crazy....

> So its about the target side requiring more properties than the source has - not about per property modifiers difference Indeed. Still, I don't understand why TS isn't doing...

> You may also want to join the TypeScript Discord. Maybe I'll do it next time. > * resources are limited. Is a flag check really what is the most...

I was reading about `in out` annotations in the announcement of 4.7 (couldn't find them in the doc when searching on Google). The initial issue is in fact solved by...

> `Array` is intentionally covariant because making `Dog[]` not be assignable to `Animal[]` would break a lot of real-world code. A code that would make that is already kind of...

> @denis-migdal I'm just going to ask that you _please_ not learn TypeScript's various ins and outs via filing bugs on the issue tracker. I'm sorry for that, but you'll...

> This is, in fact, exactly what happens. The annotations were added later because TS sometimes gets it wrong. When TS gets it wrong on very basic examples... is it...

> This is a classic invariant case - "represented" as `in out` in TS. This works very much as expected and is correct. If you are after soundness you should,...

> methods are bivariant in TS. You might not agree with this decision but it's here to stay. And this decision is an example of a design flaw: This produces...