TypeScript/tests/cases
James Keane dfedb24f75 Jsdoc @constructor - in constructor properly infer this as class instance (#25980)
* Properly infer `this` in tagged `@constructor`s.

`c.prototype.method = function() { this }` was already supported.

This commit add support to two more kinds relying on the JSDoc
`@constructor` tag. These are:
 1. `/** @constructor */ function Example() { this }`
 2. `/** @constructor */ var Example = function() { this }`

* Update the baseline for js constructorFunctions.

C3 and C4 `this` was set as `any`, now it is properly showing as
the class type.

* Fix lint errors

* Add circular initialisers to constructo fn tests.

* Error (`TS2348`) if calling tagged js constructors

When calling a JS function explicitly tagged with either `@class` or
`@constructor` the checker should throw a TS2348 not callable error.

* Don't resolve jsdoc classes with construct sigs.

This undoes the last commit that sought to change how js functions
tagged with `@class` were inferred. For some reason, currently
unknown, giving those functions construct signatures causes issues
in property assignment/member resolution (as seen in the
`typeFromPropertyAssignment12` test case).

Instead of changing the signature resolution, the error is explicitly
generated in `resolveCallExpression` for those functions.
2018-07-31 13:52:39 -07:00
..
compiler Support deleting all unused type parameters in a list, and deleting @template tag (#25748) 2018-07-27 11:55:31 -07:00
conformance Jsdoc @constructor - in constructor properly infer this as class instance (#25980) 2018-07-31 13:52:39 -07:00
fourslash Ignore trailing comma when resolving signature for quick info (#25841) 2018-07-31 11:39:39 -07:00
project
projects
test262-harness
unittests
user Add bailout case to sourcemap searching code (#25212) 2018-06-28 11:40:31 -07:00