Skip to content

Compiler / language service hang #7081

Closed
@mburnell

Description

@mburnell

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:

var a = new Rx.Subject<string>();
var b = new Rx.Subject<Immutable.Set<number>>();
var c = a.withLatestFrom(b, x => x);

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions