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

fix for never error types in TaggedRequest.Any #655

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading