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

Regression: Promise-related type inferencing failing in 2.4.1 #16940

Closed
jklmli opened this issue Jul 5, 2017 · 6 comments
Closed

Regression: Promise-related type inferencing failing in 2.4.1 #16940

jklmli opened this issue Jul 5, 2017 · 6 comments
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@jklmli
Copy link

jklmli commented Jul 5, 2017

TypeScript Version: 2.4.1

After upgrading from 2.3.4, some tests fail to inference correctly. An overloaded method that's called resolves to the wrong version, and the only workaround I can find is explicitly declaring the correct variable type to choose the correct overloaded method.

Here is a repo/branch/CI with a repro:

  1. Baseline - master on 2.3.4
  2. Trying to upgrade to 2.4.1 - note the errors (lint needs to compile the files)
  3. Forced type casts - tests pass now

Each CI run is a single commit, you can jump to the Github links to see what changed.

@yuit
Copy link
Contributor

yuit commented Jul 5, 2017

@jiaweihli could you share the small repo of the issue? also from reading the description, I think this may be the cause (https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#stricter-variance-in-callback-parameters)

@yuit yuit added the Needs More Info The issue still hasn't been fully clarified label Jul 5, 2017
@jklmli
Copy link
Author

jklmli commented Jul 6, 2017

Here is the full branch I repro'd this on: https://github.com/jiaweihli/monapt/commits/upgrade-to-ts-2.4

@kitsonk
Copy link
Contributor

kitsonk commented Jul 6, 2017

could you share the small repo of the issue?

Here is the full branch I repro'd this on

😖

@jklmli
Copy link
Author

jklmli commented Jul 6, 2017

The code is open-source, and I documented each step I took in a separate commit. Each of these has also been run independently through CI.

Do you still need a small repro?

@kitsonk
Copy link
Contributor

kitsonk commented Jul 6, 2017

Do you still need a small repro?

I am not part of the TypeScript team, but I think the answer will be yes. It is like saying "go read through the TypeScript source code to find your issue, it is open source, all the commits are there."

@jklmli
Copy link
Author

jklmli commented Aug 9, 2017

Similar to DefinitelyTyped/DefinitelyTyped#11027

@jklmli jklmli closed this as completed Aug 9, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

3 participants