-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Mapped TypesThe issue relates to mapped typesThe issue relates to mapped types
Milestone
Description
TypeScript Version: 3.2.2
Search Terms:
error TS2321: Excessive stack depth comparing types
lodash
Code
import { PartialDeep, pick } from 'lodash';
type MapFunc<T> = (data: PartialDeep<T>) => PartialDeep<T>;
function testFunc<T>(): MapFunc<T> {
return data => pick<PartialDeep<T>>(data, []) as PartialDeep<T>;
}{
"compilerOptions": {
"target": "es2018",
"module": "commonjs",
"lib": ["es2018", "dom"],
"strict": true,
"noEmitOnError": true
}
}Expected behavior:
This code should compile with TS 3.2 as it will with TS 3.1
Actual behavior:
Compliation fails with the following error
error TS2321: Excessive stack depth comparing types 'PartialDeep<T>' and 'PartialDeep<PartialDeep<T>>'.
Found 2 errors.
gnapse, IgorSzymanski, GabrielCastro, Yaojian, aleitamar and 30 morethiagofranchin
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Mapped TypesThe issue relates to mapped typesThe issue relates to mapped types