Skip to content

Commit

Permalink
Use never instead of any with Maybe.None (WICG#1335)
Browse files Browse the repository at this point in the history
Although any was safe due to the underlying field being readonly, never
enables more precise type-checking, as such a value can never exist.
  • Loading branch information
apasel422 authored Jun 12, 2024
1 parent 60c77e0 commit 1a98850
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ts/src/header-validator/maybe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type Maybeable<T> = T | Maybe<T>

export class Maybe<T> {
static readonly None: Maybe<any> = new Maybe()
static readonly None = new Maybe<never>()

static some<T>(t: T): Maybe<T> {
return new Maybe(t)
Expand Down

0 comments on commit 1a98850

Please sign in to comment.