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.
15 lines
No EOL
574 B
Text
15 lines
No EOL
574 B
Text
tests/cases/compiler/genericObjectCreationWithoutTypeArgs.ts(6,26): error TS1005: '(' expected.
|
|
|
|
|
|
==== tests/cases/compiler/genericObjectCreationWithoutTypeArgs.ts (1 errors) ====
|
|
class SS<T>{
|
|
|
|
}
|
|
|
|
var x1 = new SS<number>(); // OK
|
|
var x2 = new SS < number>; // Correctly give error
|
|
~
|
|
!!! error TS1005: '(' expected.
|
|
var x3 = new SS(); // OK
|
|
var x4 = new SS; // Should be allowed, but currently give error ('supplied parameters do not match any signature of the call target')
|
|
|