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.
TypeScript Version: 3.2.2
Search Terms:
error TS2321: Excessive stack depth comparing types
lodash
Code
{ "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