Closed scalixtro closed 1 year ago
Hmm, looks like an introduced failure in new versions of TypeScript. It used to be TypeScript understood all the classes -Demon
, Horror
, Sorcerer
- to be coming from the same place, so instances of Horror
would all be assignable to each other. Newer versions of TypeScript no longer seem to. I'll send a PR to fix. Thanks for reporting @scalixtro!
This should be fixed if you pull in the latest commits on the main
branch. Please do post back if that's not the case. Thanks again for reporting @scalixtro!
Bug Report Checklist
main
branch of the repository.Expected
Class
MockHorror
is assignable to exported classHorror
.Actual
Got an error
Argument of type 'MockHorror' is not assignable to parameter of type 'Horror & Horror'. Type 'MockHorror' is missing the following properties from type 'Horror': #consumed, #consume, doBattle, getPower
when I run the commandnpm run tsc -- --watch
in thethe-shape-of-types
project.Impacted Project
projects/classes/the-shape-of-types
Additional Info
solution.ts
code intoindex.ts
to see if there was something wrong with my solution, but the error persisted.