question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Derived types not resolved in TypeScript 3.9

See original GitHub issue

To reproduce:

  1. Make a type with a derived member
  2. See that ResolveState correctly unwraps the Derive type in TS 3.8: image
  3. Change TS to 3.9 and see that the type is no longer unwrapped: image
  4. Any attempt to use the derived state will not compile.

Not sure if this is a TS bug or just a result of stricter type checking in 3.9…

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
christianalfonicommented, Jun 7, 2020

Next release will fix this once and for all, also giving some new capabilities. Stay tuned tomorrow 😄

1reaction
christianalfonicommented, May 20, 2020

Okay, this still does not fix Derive… but it is necessary to move to TS 3.9. So the derived is the way to go as that is the only way currently known to handle the circular typing of derived state.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - TypeScript 3.9
The function's types declare that it takes two string s so that other TypeScript users can get type-checking errors, but it also does...
Read more >
Documentation - Advanced Types - TypeScript
This page lists some of the more advanced ways in which you can model types, it works in tandem with the Utility Types...
Read more >
Documentation - Type Compatibility - TypeScript
Type compatibility in TypeScript is based on structural subtyping. ... When a type system has this property, it is said to not be...
Read more >
Documentation - TypeScript 3.8
Type -Only Imports and Export. This feature is something most users may never have to think about; however, if you've hit issues under...
Read more >
Documentation - TypeScript 3.7
yell(str) { · assert(typeof str === "string"); · return str.toUppercase(); · // ~~~~~~~~~~~ · // error: Property 'toUppercase' does not exist on type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found