# Bug Report ### π Search Terms Generic types nonnullable ### π Version & Regression Information This bug appears to exist ever since NonNullable was introduced (tested from 3.3.3 to 4.5.4) ### β― Playground Link [Playground link with relevant code](https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABFAFgJzgdwJLAHIgA2hAhgEaECmAPACoB8AFALABQiiAbiYSJQFyJaAGjYBKQXgQFi5KnXqIA3mw4xgiRt16VEAQgC8BxOAAmlYDDCVTAAoBk9rjz76jiMEUJjlqjojRKKBA0JG0+AG4-AF82P1QMTEQAUTQMNEYAchlSCkpMsTZY1iA) ### π» Code ```typescript function throwIfNullable<T>( value: T, ): NonNullable<T> { if (value !== undefinedΒ && value !== null) { return value; } throw Error('Nullable') } ``` ### π Actual behavior The line `return value` raises a compilation error `Type 'T' is not assignable to type 'NonNullable<T>'.` ### π Expected behavior No compilation error as the if clause properly guards against nullish values