logoProsperBao

热身挑战

2022-03-01 03

Hello World

题目来源(type-challenges)

问题

在这个挑战中,你需要修改下方的代码使得测试通过(使其没有类型错误)。

// 期望是一个 string 类型
type HelloWorld = any
// 你需要使得如下这行不会抛出异常
type test = Expect<Equal<HelloWorld, string>>

解答

type HelloWorld = string