Skip to content

Commit fe9ca72

Browse files
committed
Accept new baselines
1 parent aeae05e commit fe9ca72

4 files changed

+45
-3
lines changed

tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.errors.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterInd
2525
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(16,47): error TS2313: Type parameter 'V' has a circular constraint.
2626
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(18,32): error TS2313: Type parameter 'T' has a circular constraint.
2727
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(18,45): error TS2313: Type parameter 'V' has a circular constraint.
28+
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(23,24): error TS2313: Type parameter 'S' has a circular constraint.
2829

2930

30-
==== tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts (27 errors) ====
31+
==== tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts (28 errors) ====
3132
class C<U extends T, T extends U> { }
3233
~
3334
!!! error TS2313: Type parameter 'U' has a circular constraint.
@@ -99,4 +100,12 @@ tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterInd
99100
~
100101
!!! error TS2313: Type parameter 'T' has a circular constraint.
101102
~
102-
!!! error TS2313: Type parameter 'V' has a circular constraint.
103+
!!! error TS2313: Type parameter 'V' has a circular constraint.
104+
105+
// Repro from #25740
106+
107+
type Foo<T> = [T] extends [number] ? {} : {};
108+
function foo<S extends Foo<S>>() {}
109+
~~~~~~
110+
!!! error TS2313: Type parameter 'S' has a circular constraint.
111+

tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ var a: {
1616
var b = <U extends T, T extends U>() => { }
1717
var b2 = <T extends U, U extends V, V extends T>() => { }
1818

19-
class D<U extends T, T extends V, V extends T> { }
19+
class D<U extends T, T extends V, V extends T> { }
20+
21+
// Repro from #25740
22+
23+
type Foo<T> = [T] extends [number] ? {} : {};
24+
function foo<S extends Foo<S>>() {}
25+
2026

2127
//// [typeParameterIndirectlyConstrainedToItself.js]
2228
var C = /** @class */ (function () {
@@ -39,3 +45,4 @@ var D = /** @class */ (function () {
3945
}
4046
return D;
4147
}());
48+
function foo() { }

tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.symbols

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,16 @@ class D<U extends T, T extends V, V extends T> { }
9090
>V : Symbol(V, Decl(typeParameterIndirectlyConstrainedToItself.ts, 17, 33))
9191
>T : Symbol(T, Decl(typeParameterIndirectlyConstrainedToItself.ts, 17, 20))
9292

93+
// Repro from #25740
94+
95+
type Foo<T> = [T] extends [number] ? {} : {};
96+
>Foo : Symbol(Foo, Decl(typeParameterIndirectlyConstrainedToItself.ts, 17, 50))
97+
>T : Symbol(T, Decl(typeParameterIndirectlyConstrainedToItself.ts, 21, 9))
98+
>T : Symbol(T, Decl(typeParameterIndirectlyConstrainedToItself.ts, 21, 9))
99+
100+
function foo<S extends Foo<S>>() {}
101+
>foo : Symbol(foo, Decl(typeParameterIndirectlyConstrainedToItself.ts, 21, 45))
102+
>S : Symbol(S, Decl(typeParameterIndirectlyConstrainedToItself.ts, 22, 13))
103+
>Foo : Symbol(Foo, Decl(typeParameterIndirectlyConstrainedToItself.ts, 17, 50))
104+
>S : Symbol(S, Decl(typeParameterIndirectlyConstrainedToItself.ts, 22, 13))
105+

tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.types

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,16 @@ class D<U extends T, T extends V, V extends T> { }
9292
>V : V
9393
>T : T
9494

95+
// Repro from #25740
96+
97+
type Foo<T> = [T] extends [number] ? {} : {};
98+
>Foo : Foo<T>
99+
>T : T
100+
>T : T
101+
102+
function foo<S extends Foo<S>>() {}
103+
>foo : <S>() => void
104+
>S : S
105+
>Foo : Foo<T>
106+
>S : S
107+

0 commit comments

Comments
 (0)