Skip to content

Instantly share code, notes, and snippets.

@erukiti
Created August 24, 2017 07:20
Show Gist options
  • Select an option

  • Save erukiti/4d1c127d21de76d803ed3e1c3dd8516c to your computer and use it in GitHub Desktop.

Select an option

Save erukiti/4d1c127d21de76d803ed3e1c3dd8516c to your computer and use it in GitHub Desktop.
TypeScript はダックタイピングな型判定しやがるらしい
class Dog {
voice() {
return 'wanwan'
}
}
class Cat {
voice() {
return 'nya-n'
}
}
const cat:Cat = new Dog()
console.log(cat.voice())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment