Skip to content

Commit

Permalink
Schema: fix templateLiteral signature (R should be never) (#1975)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored Jan 25, 2024
1 parent 8d1f6e4 commit c7550f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-files-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": patch
---

fix templateLiteral signature (R should be never)
4 changes: 2 additions & 2 deletions packages/schema/src/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,9 @@ export type Join<T> = T extends [infer Head, ...infer Tail]
* @category constructors
* @since 1.0.0
*/
export const templateLiteral = <T extends [Schema<any, any>, ...Array<Schema<any, any>>]>(
export const templateLiteral = <T extends [Schema<never, any>, ...Array<Schema<never, any>>]>(
...[head, ...tail]: T
): Schema<Schema.Context<T[number]>, Join<{ [K in keyof T]: Schema.To<T[K]> }>> => {
): Schema<never, Join<{ [K in keyof T]: Schema.To<T[K]> }>> => {
let types: ReadonlyArray<AST.TemplateLiteral | AST.Literal> = getTemplateLiterals(head.ast)
for (const span of tail) {
types = ReadonlyArray.flatMap(
Expand Down

0 comments on commit c7550f9

Please sign in to comment.