Skip to content

Commit c3b898c

Browse files
fix: assert index as typeof solution in shape-of-types (#184)
1 parent 4b8177c commit c3b898c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

projects/classes/the-shape-of-types/src/index.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import * as solution from "./solution";
55

66
const { Demon, Horror, Sorcerer } = process.env.TEST_SOLUTIONS
77
? solution
8-
: index;
8+
: // In theory, it would be nice to not have to apply this cast
9+
// In practice, TypeScript's structural typing does not play well with # privates
10+
// See https://github.com/LearningTypeScript/projects/issues/183
11+
(index as unknown as typeof solution);
912

1013
class MockHorror extends Horror {
1114
name = "";

0 commit comments

Comments
 (0)