* Include type parameter defaults in contextual typing
* Add tests
* Add additional an test for instantiating contextual signature using default type param (#51002)
* Update comment
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
* Remove language version check for extended escapes.
* Accepted baselines.
* Record whether nodes have extended Unicode escapes. Replace them in the es2015 transform.
* Accepted baselines.
* Move file to better-reflect generality of tests.
* Added tests for variables at the top level.
* Accepted baselines.
* Added test for extended astral character.
* Accepted baseline.
* Enable sourcemaps in tests.
* Accepted baselines.
* Call `setOriginalNode` on identifiers with extended escapes.
* `in` proves property presence only if property can't be undefined
* Accept new baselines
* Add tests
* Accept new baselines
* Properly compute SymbolFlags.Optional for intersected properties
* Accept new baselines
* Check optionality only for property-like declarations
* Add more tests
* Improve checking of `in` operator
* Accept new baselines
* Add tests
* Delete old and accept new baselines
* Disallow right operand of type '{}'
* Accept new baselines
* Support number and symbol literals
* Add tests
* Disallow {} typed right operand only in strictNullChecks mode
* Accept new baselines
* Detect {} resulting from intersections
* Accept new baselines
* Don't attempt to reduce intersections with Record<K, unknown>
* Accept new baselines
* Return undefined instead of unknownSymbol from getGlobalRecordSymbol()
* don't elide imports in JS files
* WIP: get rid of caching of resolved symbol, add transform tests
* get rid of caching only for resolver functions
* use getReferencedSymbol instead of getReferencedValueSymbol in module transform
* WIP: add reportErrors flag to resolveName
* Import transformations now work correctly
* don't emit diagnostics when looking up referenced symbol
* small fixes and get rid of unnecessary comments
* update tests
* clean up
* CR: use nameNotFoundMessage to decide whether to report errors in resolveName
* WIP
* implement typequery contains reference check + tests
* add unit test
* fix unit test
* use symbols in scope to check type query type parameter references
* remove comment on unit test
* remove comment
* use isNodeDescendantOf implementation to check scoping
* CR: small fixes
* treat the different kinds of type parameter declarations
* undo test change
* make `RegExpExecArray` always include index 0
* update baseline
* remove `BaseRegExpArray` interface
* add test
Co-authored-by: DetachHead <detachhead@users.noreply.github.com>
* Defer distributing index over generic object types
* Only check if the index type should be deferred for intersection types
* Add an additional test case
* Retain name and propertyName in declaration emit copies of binding patterns if property name is a keyword
* Accept baselines
* Remove out of date file
* fix first match in `RegExpMatchArray` being possibly undefined when `noUncheckedIndexedAccess` is enabled
* fix tests
* add test
Co-authored-by: DetachHead <detachhead@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Merge multiple symbols even when re-exported
As far as I remember, the target of `mergeSymbol` needs to be a merged
symbol, not a symbol with a mergeId that points to mergedSymbol.
However, mergeSymbolTable didn't check for this.
I can't remember if symbol tables may contain
symbols-with-mergeId. If they can, then mergeSymbolTable needs to call
getMergedSymbol on the individual targets of the merge. That's what I
did in this PR.
* Call getMergeSymbol eagerly
On the source, not target, of mergeSymbolTable's contents
* Fixed a false positive related to binding patterns and spread expressions
* Improve ancestor lookup when checking if an expression is spread into an object
* Fixed ancestor lookup for more node types
* Remove equality check for contextual types
* Reformat code
* Use `isWithinSpreadAssignment` flag + `objectsWithinSpread` cache instead of ancestor traversal
* Revert "Use `isWithinSpreadAssignment` flag + `objectsWithinSpread` cache instead of ancestor traversal"
This reverts commit be387e3bbf8a5cce2bc4c31fd77b061ea6cf8e0b.
* Expand on the existing comment
* Add test where the errors are reported in different file
Test for #49739
* Report error only on local declaration with additional related information
Fixes#49739
* Handle existing tests