-
-
Save vkurchatkin/00109aa9ac3f62af27400be88c7b8a9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Animal = | |
| { t: 'Cat' } | |
| { t: 'Dog' } | |
; | |
function addADog(arr: Array<Animal>) { | |
arr.push({ t: 'Dog' }); | |
} | |
const cats: Array<{ t: 'Cat' }>= []; | |
addADog(cats); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment