TypeScript/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.errors.txt
Cyrus Najmabadi d796bf1e0a Improve the flexibility of speculative parsing.
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.
2014-12-04 08:53:45 -08:00

15 lines
574 B
Plaintext

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')