There was an error while loading. Please reload this page.
1 parent 5fea975 commit 2c52f29Copy full SHA for 2c52f29
docs/types/moving-types.md
@@ -88,8 +88,8 @@ type Colors = keyof typeof colors;
88
let color: Colors; // same as let color: "red" | "blue"
89
color = 'red'; // okay
90
color = 'blue'; // okay
91
-color = 'reddish; // Error: Type '"reddish"' is not assignable to type '"red" | "blue"'.
92
-color = 'anythingElse'; // Error: Type '"anythingElse"' is not assignable to type '"red" | "blue"'.
+color = 'reddish; // Error: Type '"reddish"' is not assignable to type '"red" | "blue"'
+color = 'anythingElse'; // Error: Type '"anythingElse"' is not assignable to type '"red" | "blue"'
93
```
94
95
This allows you to have stuff like string enums + constants quite easily, as you just saw in the above example.
0 commit comments