-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Compiler / language service hang #7081
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
Comments
After talking with @vladima more about this, the root cause is trying to relate lots of nearly-similar types (mostly collection types, according to Vlad). Unlike #7097 and #5695, they are not types that are incorrectly not identical -- they legitimately are similar-but-different. Unfortunately, that means that #7097 and #5695 can have ad-hoc fixes: make the identical types actually identical. But this bug needs a faster way to relate nearly-identical types in a union. |
This fix should be available in today's nightly build ( |
Thanks - the fix works perfectly. |
I've come across code that will hang tsc.exe (v1.7.5) (and anything that uses the language service, such as Visual Studio, which is where I initially encountered it). I'm sorry I can't narrow this down to more specific language constructs, but you can reproduce this with two popular libraries and three lines of code.
Using rxjs' rx.all.d.ts (4.0.7) file and immutablejs' Immutable.d.ts (3.7.6), the following three lines will cause a hang when compiled using tsc.exe:
The third line is impossible to key into an editor running the TS language service; it will hang when attempting to type the lambda. My guess is that there's a problem attempting to infer the type of x. I have found that manually specifying the type works around the issue, i.e.:
var c = a.withLatestFrom<Immutable.Set<number>, string>(b, x => x);
works correctly, but manually specifying types that (normally) can be inferred makes me sad. I'm aware of issue #5849, and thought it might just be that, but I see that was ironed out in 1.7.5. I've also tried to compile using the 1.8 beta and I get the same result. To clarify, when I say "hang", I mean I've given tsc.exe 30+ minutes to complete and it hasn't.
The text was updated successfully, but these errors were encountered: