-
-
Save dnaumenko/240248739fbbe43e66570e3169712ed8 to your computer and use it in GitHub Desktop.
tp_sc_3
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 A { kind: "A", propA: string } | |
interface B { kind: "B", propB: string } | |
function foo(param: A | B): string { | |
switch (param.kind) { | |
case "A": | |
return 'foo' | |
case "B": | |
return 'bar' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment