1
Fork 0

Add correction to standup thingy

This commit is contained in:
prescientmoon 2025-06-18 23:07:36 +02:00
parent 2af4fc691b
commit e77cc19615
Signed by: prescientmoon
SSH key fingerprint: SHA256:WFp/cO76nbarETAoQcQXuV+0h7XJsEsOCI0UsyPIy6U

View file

@ -74,7 +74,7 @@ The issue is that (informally), at every point, TypeScript keeps track of the ti
```ts
const nums: number[] = [0]
const arr: (number | string)[] = nums
arr.push("oops") // works
arr.push("oops") // works, even though we're still referencing the same array!
```
Duck typing the procedure multiple times (as suggested by Casey) will not fix the issue, as the issue is not tied to procedures in the first place. As stated above, the issue arises from TypeScript' treatment of array variance, which could be trivially fixed if backwards compatibility wasn't a concern.