type sex = "男" | "女"; function getSex(s: sex): string { <!-- 传入过来的这个参数 s 只能够是男或者是女 --> return s; } getSex("男"); //只能够传递男或者是女