Closed
Description
Found in Formik by @weswigham who patiently worked with me to find the minimal repro.
Run the following with strictNullChecks
interface Options {
a?: number | object;
b: () => void;
}
class C<T extends Options> {
foo!: { [P in keyof T]: T[P] }
method() {
let { a, b } = this.foo;
!(a && b)
a
// TypeScript issues an error on 'a' above:
// Variable 'a' is used before being assigned.'
}
}