Closed as not planned
Closed as not planned
Description
Bug Report
Code does not compile.
🔎 Search Terms
"Operator '+' cannot be applied to types".
🕗 Version & Regression Information
4.7.4
💻 Code
const foo = { foo: 123, bar: 'bar' };
for (const k of ['foo', 'bar'] as const) {
const val = foo[k];
console.log(val + val);
}
🙁 Actual behavior
src/test.ts:5:15 - error TS2365: Operator '+' cannot be applied to types 'string | number' and 'string | number'.
🙂 Expected behavior
No error.