Skip to content

Commit 128b090

Browse files
committed
Use object for empty payload fields so the fixture satisfies its constraint with the new non-nullish meaning of {}.
1 parent e8955e7 commit 128b090

4 files changed

Lines changed: 23 additions & 23 deletions

File tree

‎tsc/testdata/baselines/reference/compiler/inferenceThroughGenericAliasCallSignature.errors.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ inferenceThroughGenericAliasCallSignature.ts(54,26): error TS2571: Object is of
4545
}
4646
: never;
4747

48-
type MessagePayload = { objects: {}; scalars: { body: string } };
49-
type ConversationPayload = { objects: { messages: MessagePayload[] }; scalars: {} };
50-
type ThreadPayload = { objects: { conversations: ConversationPayload[] }; scalars: {} };
48+
type MessagePayload = { objects: object; scalars: { body: string } };
49+
type ConversationPayload = { objects: { messages: MessagePayload[] }; scalars: object };
50+
type ThreadPayload = { objects: { conversations: ConversationPayload[] }; scalars: object };
5151

5252
declare function findThread<A>(args: A): FindResult<ThreadPayload, A>;
5353

‎tsc/testdata/baselines/reference/compiler/inferenceThroughGenericAliasCallSignature.symbols‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,38 +140,38 @@ type FindResult<P extends Payload, A> = A extends { select: infer S extends obje
140140
}
141141
: never;
142142

143-
type MessagePayload = { objects: {}; scalars: { body: string } };
143+
type MessagePayload = { objects: object; scalars: { body: string } };
144144
>MessagePayload : Symbol(MessagePayload, Decl(inferenceThroughGenericAliasCallSignature.ts, 36, 10))
145145
>objects : Symbol(objects, Decl(inferenceThroughGenericAliasCallSignature.ts, 38, 23))
146-
>scalars : Symbol(scalars, Decl(inferenceThroughGenericAliasCallSignature.ts, 38, 36))
147-
>body : Symbol(body, Decl(inferenceThroughGenericAliasCallSignature.ts, 38, 47))
146+
>scalars : Symbol(scalars, Decl(inferenceThroughGenericAliasCallSignature.ts, 38, 40))
147+
>body : Symbol(body, Decl(inferenceThroughGenericAliasCallSignature.ts, 38, 51))
148148

149-
type ConversationPayload = { objects: { messages: MessagePayload[] }; scalars: {} };
150-
>ConversationPayload : Symbol(ConversationPayload, Decl(inferenceThroughGenericAliasCallSignature.ts, 38, 65))
149+
type ConversationPayload = { objects: { messages: MessagePayload[] }; scalars: object };
150+
>ConversationPayload : Symbol(ConversationPayload, Decl(inferenceThroughGenericAliasCallSignature.ts, 38, 69))
151151
>objects : Symbol(objects, Decl(inferenceThroughGenericAliasCallSignature.ts, 39, 28))
152152
>messages : Symbol(messages, Decl(inferenceThroughGenericAliasCallSignature.ts, 39, 39))
153153
>MessagePayload : Symbol(MessagePayload, Decl(inferenceThroughGenericAliasCallSignature.ts, 36, 10))
154154
>scalars : Symbol(scalars, Decl(inferenceThroughGenericAliasCallSignature.ts, 39, 69))
155155

156-
type ThreadPayload = { objects: { conversations: ConversationPayload[] }; scalars: {} };
157-
>ThreadPayload : Symbol(ThreadPayload, Decl(inferenceThroughGenericAliasCallSignature.ts, 39, 84))
156+
type ThreadPayload = { objects: { conversations: ConversationPayload[] }; scalars: object };
157+
>ThreadPayload : Symbol(ThreadPayload, Decl(inferenceThroughGenericAliasCallSignature.ts, 39, 88))
158158
>objects : Symbol(objects, Decl(inferenceThroughGenericAliasCallSignature.ts, 40, 22))
159159
>conversations : Symbol(conversations, Decl(inferenceThroughGenericAliasCallSignature.ts, 40, 33))
160-
>ConversationPayload : Symbol(ConversationPayload, Decl(inferenceThroughGenericAliasCallSignature.ts, 38, 65))
160+
>ConversationPayload : Symbol(ConversationPayload, Decl(inferenceThroughGenericAliasCallSignature.ts, 38, 69))
161161
>scalars : Symbol(scalars, Decl(inferenceThroughGenericAliasCallSignature.ts, 40, 73))
162162

163163
declare function findThread<A>(args: A): FindResult<ThreadPayload, A>;
164-
>findThread : Symbol(findThread, Decl(inferenceThroughGenericAliasCallSignature.ts, 40, 88))
164+
>findThread : Symbol(findThread, Decl(inferenceThroughGenericAliasCallSignature.ts, 40, 92))
165165
>A : Symbol(A, Decl(inferenceThroughGenericAliasCallSignature.ts, 42, 28))
166166
>args : Symbol(args, Decl(inferenceThroughGenericAliasCallSignature.ts, 42, 31))
167167
>A : Symbol(A, Decl(inferenceThroughGenericAliasCallSignature.ts, 42, 28))
168168
>FindResult : Symbol(FindResult, Decl(inferenceThroughGenericAliasCallSignature.ts, 26, 52))
169-
>ThreadPayload : Symbol(ThreadPayload, Decl(inferenceThroughGenericAliasCallSignature.ts, 39, 84))
169+
>ThreadPayload : Symbol(ThreadPayload, Decl(inferenceThroughGenericAliasCallSignature.ts, 39, 88))
170170
>A : Symbol(A, Decl(inferenceThroughGenericAliasCallSignature.ts, 42, 28))
171171

172172
const thread = findThread({
173173
>thread : Symbol(thread, Decl(inferenceThroughGenericAliasCallSignature.ts, 44, 5))
174-
>findThread : Symbol(findThread, Decl(inferenceThroughGenericAliasCallSignature.ts, 40, 88))
174+
>findThread : Symbol(findThread, Decl(inferenceThroughGenericAliasCallSignature.ts, 40, 92))
175175

176176
select: { conversations: { select: { messages: { select: { body: true } } } } },
177177
>select : Symbol(select, Decl(inferenceThroughGenericAliasCallSignature.ts, 44, 27))

‎tsc/testdata/baselines/reference/compiler/inferenceThroughGenericAliasCallSignature.types‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,23 @@ type FindResult<P extends Payload, A> = A extends { select: infer S extends obje
8585
}
8686
: never;
8787

88-
type MessagePayload = { objects: {}; scalars: { body: string } };
88+
type MessagePayload = { objects: object; scalars: { body: string } };
8989
>MessagePayload : MessagePayload
90-
>objects : {}
90+
>objects : object
9191
>scalars : { body: string; }
9292
>body : string
9393

94-
type ConversationPayload = { objects: { messages: MessagePayload[] }; scalars: {} };
94+
type ConversationPayload = { objects: { messages: MessagePayload[] }; scalars: object };
9595
>ConversationPayload : ConversationPayload
9696
>objects : { messages: MessagePayload[]; }
9797
>messages : MessagePayload[]
98-
>scalars : {}
98+
>scalars : object
9999

100-
type ThreadPayload = { objects: { conversations: ConversationPayload[] }; scalars: {} };
100+
type ThreadPayload = { objects: { conversations: ConversationPayload[] }; scalars: object };
101101
>ThreadPayload : ThreadPayload
102102
>objects : { conversations: ConversationPayload[]; }
103103
>conversations : ConversationPayload[]
104-
>scalars : {}
104+
>scalars : object
105105

106106
declare function findThread<A>(args: A): FindResult<ThreadPayload, A>;
107107
>findThread : <A>(args: A) => FindResult<ThreadPayload, A>

‎tsc/testdata/tests/cases/compiler/inferenceThroughGenericAliasCallSignature.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ type FindResult<P extends Payload, A> = A extends { select: infer S extends obje
4040
}
4141
: never;
4242

43-
type MessagePayload = { objects: {}; scalars: { body: string } };
44-
type ConversationPayload = { objects: { messages: MessagePayload[] }; scalars: {} };
45-
type ThreadPayload = { objects: { conversations: ConversationPayload[] }; scalars: {} };
43+
type MessagePayload = { objects: object; scalars: { body: string } };
44+
type ConversationPayload = { objects: { messages: MessagePayload[] }; scalars: object };
45+
type ThreadPayload = { objects: { conversations: ConversationPayload[] }; scalars: object };
4646

4747
declare function findThread<A>(args: A): FindResult<ThreadPayload, A>;
4848

0 commit comments

Comments
 (0)