I am specifying types on a function. TypeScript types are (as of current TypeScript versions) non-nullable by default. However I don't get any errors when I run a function with null or undefined.
function sayHello(name: string){
console.log(`Hello ${name}`)
}
In the code above sayHello(undefined) and sayHello(null) should both fail.
What they currently do in TypeScript 3.8.3:
Hello null
Hello undefined
vsCode gives no warnings:
Why is TypeScript not warning when setting a non-nullable value as null?

sayHello(undefined)logsHello undefined