Skip to content

Commit

Permalink
fix(VSelect): avoid distributive conditional type with unbound generic
Browse files Browse the repository at this point in the history
fixes #17383
  • Loading branch information
KaelWD committed May 16, 2023
1 parent a3150c4 commit 5bdcfde
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function highlightResult (text: string, matches: FilterMatch | undefined, length

type Primitive = string | number | boolean | symbol

type Val <T, ReturnObject extends boolean> = T extends Primitive
type Val <T, ReturnObject extends boolean> = [T] extends [Primitive]
? T
: (ReturnObject extends true ? T : any)

Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VCombobox/VCombobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function highlightResult (text: string, matches: FilterMatch | undefined, length

type Primitive = string | number | boolean | symbol

type Val <T, ReturnObject extends boolean> = string | (T extends Primitive
type Val <T, ReturnObject extends boolean> = string | ([T] extends [Primitive]
? T
: (ReturnObject extends true ? T : any))

Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VSelect/VSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import type { Component, PropType } from 'vue'

type Primitive = string | number | boolean | symbol

type Val <T, ReturnObject extends boolean> = T extends Primitive
type Val <T, ReturnObject extends boolean> = [T] extends [Primitive]
? T
: (ReturnObject extends true ? T : any)

Expand Down

0 comments on commit 5bdcfde

Please sign in to comment.