Closed
Description
I sometimes reference outer scope variables and class members in my function/method declarations. The problem is that those references are nullables. I want a way to ensure that a function is called on a call site where those references are not null.
let corns: string | null;
function makePopCorn(): string
requires corns !== null
{
return 'pop';
}
if (corns) {
makePopCorn();
}
makePopCorn(); // error corns can be null
Related #198. But not duplicate.