mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
12 lines
423 B
Plaintext
12 lines
423 B
Plaintext
forInStrictNullChecksNoError.ts(5,5): error TS18049: 'x' is possibly 'null' or 'undefined'.
|
|
|
|
|
|
==== forInStrictNullChecksNoError.ts (1 errors) ====
|
|
function f(x: { [key: string]: number; } | null | undefined) {
|
|
for (const key in x) { // 1
|
|
console.log(x[key]); // 2
|
|
}
|
|
x["no"]; // should still error
|
|
~
|
|
!!! error TS18049: 'x' is possibly 'null' or 'undefined'.
|
|
} |