Created
March 26, 2016 10:04
-
-
Save darkf/355b26c0dbeae40a4d4e 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
interface Point2D { | |
x: number; | |
y: number; | |
} | |
interface Point3D extends Point2D { | |
z: number; | |
} | |
function f(pt: Point2D) {} | |
let pt: Point3D = {x:1, y:2, z:3}; | |
f(pt); // oh hey it works on 3d points too! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment