唯一原因就是 它的对应的tsconfig.json文件 配置的缘故:
关闭了"strict": true 和 "strictNullChecks": true ,下面的都能编译通过!
let str: string = null
let str2: number = null;
let str3: boolean = null;
let str4: object = null;
let str5: unknown = null;
let str6: any = null;
let str7: void = null;