* Eliminate redundant or meaningless elaborations in type relations
* Accept new baselines
* Add resetErrorInfo (though, oddly, shouldn't be necessary)
* Less aggressive reduction in second pass union/intersection checks
* Accept new baselines
* Restructure and back off a little bit more
* Only cache union/intersection relations once
* Accept new baselines
* Properly cache identity relations, clean up error reporting
* Move more logic to cached side of relation checks
* Optimize and remove more redundant elaborations
* Accept new baselines
* Remove unnecessary error state capture
* More optimizing
* Cache isWeakType computation
* Revert "Cache isWeakType computation"
This reverts commit 25a71c4de61f6366ffac080d19685dcb200f42b9.
* Address CR feedback
* Accept new baselines
* Enable path completions for node12/nodenext
* Explicitly pull path completions from export maps when available
* Explicitly handle pattern exports by stopping up to the star
* Checker:Remove block-scoped duplicate declaration errors in plain JS
Previously they were issued in mergeSymbol, not they are not issued.
* fix semicolon lint
* Fix error term of declaration in modules
* fix test
* change error code of "An import declaration can only be used at the top level of a module."
* Separate js and ts files for export errors in module.
* Change non-top-level error in namespace
* format
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* WIP: pass in checkmode to getNarrowableTypeForReference
* add tests
* another pass through new check mode argument
* rename new check mode
* only use rest flag for rest elements in objects
* add and update tests
* change check mode flag name
* restore package-lock.json
* fix comments
* get rid of fourslash tests
* fix caching in checkExpressionCached when checkMode is not normal
* Don't distinguish between object and array rest elements
* get rid of undefined check mode
* don't make includeOptionality into checkmode flag
1. During name resolution, `@param` and `@return` tags should walk up
through the jsdoc comment and then jump to the host function. Previously they
did not, which would cause them to not resolve type parameters bound in
the scope of a host that was not a sibling of the comment. The example
from #46618 is a prototype method:
```js
/**
* @template {T}
* @param {T} t
*/
C.prototype.m = function (t) {
}
```
2. During name resolution, prototype methods are supposed to resolve
types both from the host function's location and from the containing
class' location. The containing class lookup happens in a separate call
to `resolveName`. Previously, the code that finds the containing class
only worked for the above style of comment, which is on the outer
ExpressionStatement, but not for the below style, which is on the
function expression itself:
```js
C.prototype.m =
/**
* @template {T}
* @param {T} t
*/
function (t) {
}
```
* Do symbol name filtering before cache rehydration
* Fix typo
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Update test
* Fix variable clobbered in merge conflict
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>