-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Indexed Access TypesThe issue relates to accessing subtypes via index accessThe issue relates to accessing subtypes via index accessDomain: Mapped TypesThe issue relates to mapped typesThe issue relates to mapped types
Milestone
Description
TypeScript Version: 3.6.2
Search Terms: excessive stack depth regression comparing types function lodash
Code
tsconfig.json
:
package.json
:
{
"dependencies": {
"@types/lodash": "4.14.129",
"typescript": "3.6.2"
}
}
main.ts
:
import negate from 'lodash/negate';
Expected behavior:
Compiles
Actual behavior:
$ tsc
error TS2321: Excessive stack depth comparing types 'Function<?>' and 'Function<?>'.
Found 1 error.
This error doesn't give any helpful information for debugging.
Upgrading @types/lodash
to the latest version (4.14.138 at time of writing) seems to fix the issue.
If we disable strictNullChecks
, we get a bit more information about the error (for some reason?):
$ tsc
error TS2321: Excessive stack depth comparing types 'Function<?>' and 'Function<?>'.
node_modules/@types/lodash/ts3.1/common/common.d.ts:194:15 - error TS2589: Type instantiation is excessively deep and possibly infinite.
194 interface Object<T> extends LoDashImplicitWrapper<T> {
~~~~~~
Found 2 errors.
This did not error in TS 3.5, so I think it's a regression?
Playground Link:
Related Issues:
AnyhowStep, rachid-debu, luketanner, ctretyak and wongjiahaukarol-majewski, sevenryze, samijaber, rachid-debu, luketanner and 1 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Indexed Access TypesThe issue relates to accessing subtypes via index accessThe issue relates to accessing subtypes via index accessDomain: Mapped TypesThe issue relates to mapped typesThe issue relates to mapped types