Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
expected { a: 1 } to deeply equal { a: 1 }
The description is incorrect: there are 5 arguments, not 4.
Hi,
I think this kata is not compatible with TS 4.9+ (4.9 just has been made available on CW). I think it's because of the new Auto-Accessors feature: using this just before applying the mixins:
meaning
applyMixins
is still updating the prototype of Person/Robot, but those are shadowed anyway by the instance accessors, which are returning undefined (because of the way the Person class is defined).I'm not sure what should be done (retire the kata? maybe there is a way to fix that anyway?)
Anyone?
This comment is hidden because it contains spoiler information about the solution
I think solutions to this example should try to make use of TS typecheck at compile time to get the intersecting types.
Like I tried here: https://www.codewars.com/kata/reviews/5916d24f81639e467a0009d8/groups/5e233520aa63470001e3ed38
I don't know if there is an Utility Type for that:
R extends { [K in keyof U]: K extends keyof T ? U[K] : never }
?Anyways it was fun trying to make it myself
This comment is hidden because it contains spoiler information about the solution
Never type is not validated to be unreachable, in other words you can put any function and it will pass for that type even if it's not of type never.
The result doesn't have all properties of
T
orU
, it clearly isn'tT & U
. (And types aren't checked anyway.)This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution