We now no longer fail a speculative parse just because an error was encountered at any point while speculating. instead, we allow the speculative function that is being called to determine if the parse was successful or not. Only if it decides it was not successful is parsing rewound. This improves our error recovery in several cases (esp. around arrow functions). it will also help in a followup refactoring to prevent lookahead/speculative parsing from causing lambda allocations.
16 lines
No EOL
460 B
Text
16 lines
No EOL
460 B
Text
tests/cases/compiler/genericConstructExpressionWithoutArgs.ts(10,1): error TS1005: '(' expected.
|
|
|
|
|
|
==== tests/cases/compiler/genericConstructExpressionWithoutArgs.ts (1 errors) ====
|
|
class B { }
|
|
var b = new B; // no error
|
|
|
|
class C<T> {
|
|
x: T;
|
|
}
|
|
|
|
var c = new C // C<any>
|
|
var c2 = new C<number> // error, type params are actually part of the arg list so you need both
|
|
|
|
|
|
!!! error TS1005: '(' expected. |