Created
August 24, 2017 07:20
-
-
Save erukiti/4d1c127d21de76d803ed3e1c3dd8516c to your computer and use it in GitHub Desktop.
TypeScript はダックタイピングな型判定しやがるらしい
This file contains hidden or 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
| 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