Just wondering if this is expected or not:
v3
No issue here
import * as z from 'zod';
const FooSchema = z.strictObject({});
const FooSchemaExtended = FooSchema.extend({
value: z.string()
});
type Foo = z.infer<typeof FooSchema>;
type FooExtended = z.infer<typeof FooSchemaExtended>;
type PostMessage<T extends Foo> = T;
export type bar = PostMessage<FooExtended>;
v4
Issue on the last line
import * as z from 'zod/v4';
const FooSchema = z.strictObject({});
const FooSchemaExtended = FooSchema.extend({
value: z.string()
});
type Foo = z.infer<typeof FooSchema>;
type FooExtended = z.infer<typeof FooSchemaExtended>;
type PostMessage<T extends Foo> = T;
export type bar = PostMessage<FooExtended>;
the last line raises an error (that was not raised in v3):
TS2344: Type { value: string; } does not satisfy the constraint Record<string, never>
Property value is incompatible with index signature.
Type string is not assignable to type never
Just wondering if this is expected or not:
v3
No issue here
v4
Issue on the last line
the last line raises an error (that was not raised in v3):