Add correction to standup thingy
This commit is contained in:
parent
2af4fc691b
commit
e77cc19615
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue