mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
19 lines
471 B
TypeScript
19 lines
471 B
TypeScript
//// [tests/cases/compiler/forInStrictNullChecksNoError.ts] ////
|
|
|
|
//// [forInStrictNullChecksNoError.ts]
|
|
function f(x: { [key: string]: number; } | null | undefined) {
|
|
for (const key in x) { // 1
|
|
console.log(x[key]); // 2
|
|
}
|
|
x["no"]; // should still error
|
|
}
|
|
|
|
//// [forInStrictNullChecksNoError.js]
|
|
"use strict";
|
|
function f(x) {
|
|
for (const key in x) { // 1
|
|
console.log(x[key]); // 2
|
|
}
|
|
x["no"]; // should still error
|
|
}
|