#Why is the intersection not visible on hover after converting Union To Intersection?

3 messages · Page 1 of 1 (latest)

barren wigeon
#
TypeHero

Level up and learn TypeScript with interactive exercises

versed bladeBOT
#

@barren wigeon Here's a shortened URL of your playground link! You can remove the full link from your message.

kingoberon.#0

Preview:```ts
import type {
Equal,
Expect,
} from "@type-challenges/utils"

type UnionToIntersection<U> = (
U extends unknown ? (a: U) => void : never
) extends (a: infer I) => void
? I
: never

type cases = [
Expect<
Equal<
UnionToIntersection<"foo" | 42 | true>,
"foo" & 42 & true
>

,
Expect<
Equal<
UnionToInters
...```

lofty turtle