Created
December 13, 2020 12:49
-
-
Save mieszko4/e322f00ab8ccdcff8ae5ee7921526f6d to your computer and use it in GitHub Desktop.
Confused TypeScript
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 A = {a: 'a'} | {b: 'b'}; | |
const c: A = { | |
a: 'a', | |
b: 'b' | |
}; | |
type C = typeof c; // === A | |
// Confused TS: I cannot access c.a nor c.b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment