DEV Community

Discussion on: Advanced TypeScript Exercises - Question 3

 
macsikora profile image
Pragmatic Maciej • Edited

Now the interface of the function works in reverse way, what is correct is incorrect 😉

Thread Thread
 
kashyaprahul94 profile image
Rahul Kashyap • Edited

If i understood it correct, we are not allowed to change implementation of the method, just introduce types to make it work, right ?

Thread Thread
 
macsikora profile image
Pragmatic Maciej

Yes, implementation of the value level can stay, but assertion like as X is a type level. Currently implementation cannot compile because of lack of proper typing, there is a way to solve it without any assertion that is why I left it as it is, so with compile error.

You can modify the implementation, the key is to have it working as original + typed safe.