* Infer fixed-size tuples from infer type parameters with extends clauses at variadic positions
* Improve the fix to handle tuples with leading variadic elements
* Fixed indentation
* Infer rest element following a variadic element with a fixed-size constraint
* Infer rest element preceding a variadic element with a fixed-size constraint
* Rewrite the test to avoid accidental union reductions
* Fix excess property checking for intersections with index signatures
* Add regression tests
* Limit check to only fresh object literals on the source side
* feat(51000): add ignoreDeprecations option
* use constants of versions
* change the ignoreDeprecations type to allow only one value - '5.0'
* add tests
* update baseline
* add typeScriptVersion to CreateProgramOptions
* update baseline
* change diagnostic message
* Add support for JSDocOverloadTag
* Use overload tag to determine function type
* Update baselines
* Add new tests along with baselines
* Add tests for all @overload tags in one comment
* Add tests for find-all-ref and rename operations
* Add tests for alternative uses of @overload tag
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* tsconfig.extends as array
* Updated baselines
* Changes for pr
* Changes for pr comments
* Fixed formatting and edited a test
* Resolved errors after a merge conflict
* Added "string | list" type implentation
* Removed string | list type implementation
* Fixed formatting
* Added compiler test
* Resolving programUpdate errors
* Fixing commandLineParser error
* Fixed tuple types indexed by a type parameter
* If only there was a tool to add that missing semicolon for me
* Rename to baseConstraint
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Fix missed errors in switch when using union of literal and non-literal types (#38686)
This commit makes it so we don’t use the base type of literals when checking comparability in switch. The comparability checks handle that case already, is my understanding, so we don’t need to clobber the type before actually doing the check, causing missed errors.
When comparing the types in switch, if a union with a literal and a non-literal was used, the compiler in `checker.ts` would automatically get the base type of all parts of the union, resulting in missed errors. For example, if the union of the non-literal `number` and literal `"hello"` was compared to the literal `"world"` in a switch case, the compiler would miss that they’re actually not comparable.
Maybe someone can tell me why we were getting the base type before checking comparability, rather than relying on the logic within the comparability checks to handle literal/base type comparability?
* Fix lint (whitespace) issue in checker.ts by running lint with fix flag.
* Fixed an issue with `in` not being able to be used on narrowed down expression of a generic nullable type
* Add another test case from a new issue
* Move the fix to `hasEmptyObjectIntersection`
* Refactor `Extensions`, fix lookup priorities
* Update baselines
* Clean up
* Temporarily apply same fix to `node` for testing
* Revert ancestor node_modules lookups back to two passes
* Revert "Temporarily apply same fix to `node` for testing"
This reverts commit 4014f3005a.
* Update baselines
* Add new test for node_modules searching behavior
* Update new baseline
* Add known keys of the mapped type constraint to its members
* Avoid second pass of adding known members by instead passing `noReductions` to `mapType`
This adds a "small" d.ts bundler script. This script is very basic,
using Node printing to produce its output. Generally speaking, this is
inadvisable as it completely disregards name shadowing, globals, etc.
However, in our case, we don't care about the globals, and we can opt to
restructure our codebase in order to avoid conflict, which we largely
had to do anyway when we were namespaces and everything was in scope.
* Fixed a regression with discriminating unions based on a union property against `undefined` with `strictNullChecks: false`
* Add additional test case from the issue comment