Created
December 2, 2021 10:39
-
-
Save lukeknxt/a42ca8a046d38248485623b180c2ae3e to your computer and use it in GitHub Desktop.
Unions don't always type with enums!
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
enum E { | |
A = "A", | |
B = "B", | |
} | |
const yep: "A" = E.A; | |
const yep2: E = E.A; | |
const nope: E = "A"; // why though |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment