// Here declaration to be changed 🔥declarefunctiongetUser<TextendsConfig>(config:T):{name:T["name"]extendstrue?string:never,lastname:T["lastname"]extendstrue?string:never,};
Now in this case we're not getting compile errors - however the types of those values are never so depending on your use case - might be enough to prevent errors from occuring.
I am Software Developer, currently interested in static type languages (TypeScript, Elm, ReScript) mostly in the frontend land, but working actively in Python also. I am available for mentoring.
Hi David, again please pay attention I put 🛑 icon where the code should show compile error. Your implementation doesn't create such. So its not valid solution.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here's a simpler solution than has been posted:
Now in this case we're not getting compile errors - however the types of those values are
never
so depending on your use case - might be enough to prevent errors from occuring.Hi David, again please pay attention I put 🛑 icon where the code should show compile error. Your implementation doesn't create such. So its not valid solution.