Skip to content

Commit 06d07b0

Browse files
committed
Accept new baselines
1 parent e44a52a commit 06d07b0

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//// [conditionalTypeSimplification.ts]
2+
// Repro from #30794
3+
4+
interface AbstractSchema<S, V> {
5+
m1<T> (v: T): SchemaType<S, Exclude<V, T>>;
6+
m2<T> (v: T): SchemaType<S, T>;
7+
}
8+
9+
type SchemaType<S, V> = S extends object ? AnySchema<V> : never;
10+
interface AnySchema<V> extends AnySchemaType<AnySchema<undefined>, V> { }
11+
interface AnySchemaType<S extends AbstractSchema<any, any>, V> extends AbstractSchema<S, V> { }
12+
13+
14+
//// [conditionalTypeSimplification.js]
15+
// Repro from #30794
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
=== tests/cases/compiler/conditionalTypeSimplification.ts ===
2+
// Repro from #30794
3+
4+
interface AbstractSchema<S, V> {
5+
>AbstractSchema : Symbol(AbstractSchema, Decl(conditionalTypeSimplification.ts, 0, 0))
6+
>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 2, 25))
7+
>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 2, 27))
8+
9+
m1<T> (v: T): SchemaType<S, Exclude<V, T>>;
10+
>m1 : Symbol(AbstractSchema.m1, Decl(conditionalTypeSimplification.ts, 2, 32))
11+
>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 3, 5))
12+
>v : Symbol(v, Decl(conditionalTypeSimplification.ts, 3, 9))
13+
>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 3, 5))
14+
>SchemaType : Symbol(SchemaType, Decl(conditionalTypeSimplification.ts, 5, 1))
15+
>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 2, 25))
16+
>Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --))
17+
>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 2, 27))
18+
>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 3, 5))
19+
20+
m2<T> (v: T): SchemaType<S, T>;
21+
>m2 : Symbol(AbstractSchema.m2, Decl(conditionalTypeSimplification.ts, 3, 45))
22+
>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 4, 5))
23+
>v : Symbol(v, Decl(conditionalTypeSimplification.ts, 4, 9))
24+
>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 4, 5))
25+
>SchemaType : Symbol(SchemaType, Decl(conditionalTypeSimplification.ts, 5, 1))
26+
>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 2, 25))
27+
>T : Symbol(T, Decl(conditionalTypeSimplification.ts, 4, 5))
28+
}
29+
30+
type SchemaType<S, V> = S extends object ? AnySchema<V> : never;
31+
>SchemaType : Symbol(SchemaType, Decl(conditionalTypeSimplification.ts, 5, 1))
32+
>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 7, 16))
33+
>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 7, 18))
34+
>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 7, 16))
35+
>AnySchema : Symbol(AnySchema, Decl(conditionalTypeSimplification.ts, 7, 64))
36+
>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 7, 18))
37+
38+
interface AnySchema<V> extends AnySchemaType<AnySchema<undefined>, V> { }
39+
>AnySchema : Symbol(AnySchema, Decl(conditionalTypeSimplification.ts, 7, 64))
40+
>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 8, 20))
41+
>AnySchemaType : Symbol(AnySchemaType, Decl(conditionalTypeSimplification.ts, 8, 73))
42+
>AnySchema : Symbol(AnySchema, Decl(conditionalTypeSimplification.ts, 7, 64))
43+
>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 8, 20))
44+
45+
interface AnySchemaType<S extends AbstractSchema<any, any>, V> extends AbstractSchema<S, V> { }
46+
>AnySchemaType : Symbol(AnySchemaType, Decl(conditionalTypeSimplification.ts, 8, 73))
47+
>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 9, 24))
48+
>AbstractSchema : Symbol(AbstractSchema, Decl(conditionalTypeSimplification.ts, 0, 0))
49+
>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 9, 59))
50+
>AbstractSchema : Symbol(AbstractSchema, Decl(conditionalTypeSimplification.ts, 0, 0))
51+
>S : Symbol(S, Decl(conditionalTypeSimplification.ts, 9, 24))
52+
>V : Symbol(V, Decl(conditionalTypeSimplification.ts, 9, 59))
53+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=== tests/cases/compiler/conditionalTypeSimplification.ts ===
2+
// Repro from #30794
3+
4+
interface AbstractSchema<S, V> {
5+
m1<T> (v: T): SchemaType<S, Exclude<V, T>>;
6+
>m1 : <T>(v: T) => SchemaType<S, Exclude<V, T>>
7+
>v : T
8+
9+
m2<T> (v: T): SchemaType<S, T>;
10+
>m2 : <T>(v: T) => SchemaType<S, T>
11+
>v : T
12+
}
13+
14+
type SchemaType<S, V> = S extends object ? AnySchema<V> : never;
15+
>SchemaType : SchemaType<S, V>
16+
17+
interface AnySchema<V> extends AnySchemaType<AnySchema<undefined>, V> { }
18+
interface AnySchemaType<S extends AbstractSchema<any, any>, V> extends AbstractSchema<S, V> { }
19+

0 commit comments

Comments
 (0)