Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

O.Writable broken in 6.13.24 #134

Closed
xaviergonz opened this issue Jul 24, 2020 · 7 comments
Closed

O.Writable broken in 6.13.24 #134

xaviergonz opened this issue Jul 24, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@xaviergonz
Copy link

xaviergonz commented Jul 24, 2020

interface IM { n: number; }

function test<M extends IM>(m: M) {
  const fn1 = m.n; // OK
  const wm = m as O.Writable<M>;
  const fn2 = wm.n; // Property 'n' does not exist on type 'Writable<M, string | number | symbol, "flat">'.ts(2339)
}

used to work ok in 6.10.16 (and probably later).

@millsp millsp added the bug Something isn't working label Jul 24, 2020
@millsp
Copy link
Owner

millsp commented Jul 24, 2020

Arf, sorry about this again. My tests pass but the metadata is somehow lost when working with generics. Now I'm wondering how this affects the library as a whole. Thanks for reporting. Working on it.

@xaviergonz
Copy link
Author

No worries, always happy to help :)

@millsp
Copy link
Owner

millsp commented Jul 24, 2020

Amazing, thank you. The fix will be out in a few moments.

@millsp millsp closed this as completed Jul 24, 2020
@xaviergonz
Copy link
Author

I'm afraid this is happening again in the latest version :(

@millsp
Copy link
Owner

millsp commented Jul 30, 2020

You know what, I did not write tests for this, I wrote them for another utility Patch and Merge which I thought were the upstream problem... I'm so sorry, this is very unprofessional. I'm writing the same tests for all the other ones, I don't want to cause you problems anymore. Again, sorry!

@millsp millsp reopened this Jul 30, 2020
@millsp
Copy link
Owner

millsp commented Jul 30, 2020

Hey @xaviergonz. Thank you so much for this! You helped me uncover a very old, suspected bug that caused metadata loss because of (way) too much type distribution. I've added tests for all the concerned tools, I'm doing all I can to break this curse 😆.

I'm very sorry for the disturbance I caused. I hope you are still enjoying using ts-toolbelt and that you will stick to it in the future. Thanks that you helped me solve a hidden bug that was plaguing all of the most important tools of this library.

Cheers!

Fix will be out in 3 minutes

@millsp millsp closed this as completed Jul 30, 2020
millsp added a commit that referenced this issue Jul 30, 2020
this came from metadata being lost during excessive type distribution
@xaviergonz
Copy link
Author

I should be the one thanking you! After all you put a lot of time and effort into this for free 👍 Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants