TypeScript/tests/baselines/reference/noExcessiveStackDepthError.errors.txt
Anders Hejlsberg 7cbcfeea99
Exclude identity relation from mapped type relation check (#46632)
* Exclude identity relation from mapped type relation check

* Add regression test
2021-11-02 06:54:35 -07:00

22 lines
993 B
Plaintext

tests/cases/compiler/noExcessiveStackDepthError.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'FindConditions<any>', but here has type 'FindConditions<Entity>'.
==== tests/cases/compiler/noExcessiveStackDepthError.ts (1 errors) ====
// Repro from #46631
interface FindOperator<T> {
foo: T;
}
type FindConditions<T> = {
[P in keyof T]?: FindConditions<T[P]> | FindOperator<FindConditions<T[P]>>;
};
function foo<Entity>() {
var x: FindConditions<any>;
var x: FindConditions<Entity>; // Excessive stack depth error not expected here
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'FindConditions<any>', but here has type 'FindConditions<Entity>'.
!!! related TS6203 tests/cases/compiler/noExcessiveStackDepthError.ts:12:9: 'x' was also declared here.
}