Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
fix for never error types in TaggedRequest.Any
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Dec 13, 2023
1 parent c728880 commit 535ff6a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-baboons-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": patch
---

fix for never error types in TaggedRequest.Any
4 changes: 3 additions & 1 deletion docs/modules/Schema.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,9 @@ Added in v1.0.0
**Signature**

```ts
export type Any = TaggedRequest<string, any, any, any, any, any, any>
export type Any =
| TaggedRequest<string, any, any, any, any, any, any>
| TaggedRequest<string, any, any, never, never, any, any>
```
Added in v1.0.0
Expand Down
7 changes: 4 additions & 3 deletions src/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4585,7 +4585,9 @@ export declare namespace TaggedRequest {
* @category classes
* @since 1.0.0
*/
export type Any = TaggedRequest<string, any, any, any, any, any, any>
export type Any =
| TaggedRequest<string, any, any, any, any, any, any>
| TaggedRequest<string, any, any, never, never, any, any>
}
/**
Expand Down Expand Up @@ -4641,7 +4643,6 @@ const makeClass = <I, A>(
additionalProps?: any
): any => {
const validator = Parser.validateSync(selfSchema)
const pretty = Pretty.to(selfSchema)
return class extends Base {
constructor(props: any = {}, disableValidation = false) {
Expand All @@ -4654,7 +4655,7 @@ const makeClass = <I, A>(
static [TypeId] = variance
toString() {
return `${this.constructor.name}(${pretty(this as any)})`
return Pretty.to(this.constructor as any)(this)
}
static pipe() {
Expand Down

0 comments on commit 535ff6a

Please sign in to comment.