For example in Typescript, you can specify whether a parameter is allowed to be null in the signature of a function. If you do the compiler will make sure that you don't accidentally pass a null value to that function.
function foo(x: number) {
return x + 1;
}
let y = null;
foo(y); // compiler will flag this