* Fix getExpandoSymbol for already-expando symbols
getExpandoSymbol is intended to get the symbol of the expando in a
declaration like
```js
var C = class {
}
```
However, when this occurs in a `module.exports` assignment, alias
resolution already jumps to the exported symbol -- in this case the
expando symbol:
``js
// @filename: first.js
module.exports = class {
}
// @filename: other.js
/* @type {import("./first")} */
var C
```
`getExpandoSymbol` is then called on `class { }` instead of
`module.exports = class { }`.
Previously, `getExpandoSymbol` would incorrectly treat `class { }` the
same as the export assignment and get the expando ... from the expando
itself. This resulted in merging the expando with itself, which causes
bogus errors and could cause other problems.
Now `getExpandoSymbol` checks that the expando "initializer" is
different from the declaration.
* Better check for getExpandoSymbol of expando
Check the declaration directly instead of the initialiser.
* Allow `infer` type variables to have constraints infered and allow the breakdown of substitutes in simplifiable source inferences
* Still skip conditional inference when `extends infer Q` so such a pattern still acts as a constraint size breaker
* WIP
* Test no longer crashes, but emit trampoline is incomplete and skips pipeline phases
* Fix lints, use non-generator trampoline in emit (still skips pipeline)
* Final version with emitBinaryExprssion work stack that is only used if possible
* Fix lints
* retarget to es2015 for testing
* Use bespoke state machine trampolines in binder and checker
* Remove now extraneous code in parser
* Adjust fixupParentReferences to use a depth first preorder traversal rather than breadth first
* Reintroduce incremental fast bail in fixupParentReferences
* Revert target to es5
* PR feedback
* Small edit for devops rebuild with updated definition
* Fix comment nits, add internally extraneous check back into transformer
* If script info is not attached to the project on which wild card is invoked, update it.
* Instead of getting default project before starting error list timer, get it at that time if no project is specified
Fixes#35794
* Fix the open File watch triggered setting
* ESNext+[[Define]]: reference to param props illegal
When target: "esnext" and useDefineForClassFields: true, property
declaration initialisers should not be able to reference parameter
properties; class fields are initialised before the constructor runs,
but parameter properties are not:
```ts
class C {
foo = this.bar
constructor(public bar: string) { }
}
```
emits code that looks like this:
```js
class C {
bar
foo = this.bar
constructor(bar) {
this.bar = bar
}
}
new C('x').foo.length // crashes; foo is undefined
```
This PR adds an error on foo's declaration with ESNext+[[Define]].
* improve test
* Emit statements before super
When statements come before super, Typescript's emit is incorrect,
whether there is an error or not. This change preserves statements that
come before super whether there is an error or not.
Here is the case with no errors:
```ts
class Test extends Array {
p: number
constructor() {
console.log("p is initialised in the constructor below super()")
super()
this.p = 1
}
}
```
Notice that `p` is manually initialised in the constructor after
`super()` instead of at the property declaration.
* Update baselines
Parameter properties in the error case now move below the super call.
This is an improvement because it means the code is more likely to execute
correctly.
* remove outdated comments
* Change type-only semantics to allow type queries
* Don’t error using type-only import in ambient context
* Fix default import
* Fix namespace import
* Update more baselines
* Prevent circular resolution
* Track const enum expression usage
* Update baselines
* Perf tuning 1
* Test commit for perf impact
* Weave type-only alias declaration finding into alias resolution
* Fix namespace import of type-only exported symbols
* type-only exports do not contribute to the module object type
* Update APIs
* Fix enum casing, remove type-only conversion suggestion
* Short circuit type-only checks in resolveEntityName faster
* Fix casing in API
* Remove unused parameter
* Fix error on qualified names in type queries
* Allow type-only imports in computed property names
* Fix computed property names of types and abstract members
* Remove unused util
* Commit missing baselines
* Rename “check” functions so as not to overload the word “check”
* Adds support for showing default exports in the navtree - Fixes#34601
* Handle the feedback in #35477
* Navigation items using default export or export = will get noted if they are a const vs function