Bug Report
Hi, we're trying to tighten up some of our code by using noUncheckedIndexedAccess. I know there are caveats to this compiler option which we've found by searching, but this one feels more like a bug?
🔎 Search Terms
Searched a variety of issues, the most relevant being: #13778
🕗 Version & Regression Information
4.5.4
⏯ Playground Link
💻 Code
enum Meat {
Sausage,
Bacon
}
const sausage = Meat.Sausage
const value = Meat[sausage] // string | undefined
🙁 Actual behavior
value in the above example can't be undefined
🙂 Expected behavior
value to be typed as string, not string | undefined
Bug Report
Hi, we're trying to tighten up some of our code by using
noUncheckedIndexedAccess. I know there are caveats to this compiler option which we've found by searching, but this one feels more like a bug?🔎 Search Terms
Searched a variety of issues, the most relevant being: #13778
🕗 Version & Regression Information
4.5.4⏯ Playground Link
💻 Code
🙁 Actual behavior
valuein the above example can't be undefined🙂 Expected behavior
valueto be typed as string, notstring | undefined