# Bug Report <!-- Please fill in each section completely. Thank you! --> ### π Search Terms <!-- What search terms did you use when trying to find an existing bug report? List them here so people in the future can find this one more easily. --> noUncheckedIndexedAccess destructuring tuple rest elements ### π Version & Regression Information <!-- When did you start seeing this bug occur? "Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs If possible, please try testing the nightly version of TS to see if it's already been fixed. For npm: `typescript@next` This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly Note: The TypeScript Playground can be used to try older versions of TypeScript. Please keep and fill in the line that best applies: --> - This is the behavior in every version I tried ### β― Playground Link <!-- A link to a TypeScript Playground "Share" link which shows this behavior The TypeScript Workbench can be used for more complex setups, try https://www.typescriptlang.org/dev/bug-workbench/ As a last resort, you can link to a repo, but these will be slower for us to investigate. --> [Playground link with relevant code](https://www.typescriptlang.org/play?noUncheckedIndexedAccess=true#code/C4TwDgpgBAcg9gOwKIFsygMrAE4EsEDmAgttgIYhQC8UA2gM474EA0UAdJyeSADyN5CAPgC6AKDEBjRIygDm9AFyxEqdCCyDipCtToByRBH1t9wAO5wTUMwAtsEY+OkJZDAAxt6ARi8AmLwBmET15QnoAbjEAemioeITEpISAPQB+MXj6d3ZgOABVMEhsAGEyeggACgBKTLlA3IKiiFLyqtrY9KA) ### π» Code <!-- Please post the relevant code sample here as well--> ```ts type NonEmptyStringArray = [string, ...Array<string>] const strings: NonEmptyStringArray = ['one', 'two', 'three'] const [s0, s1, s2, s3] = strings; // ^? const s3: string | undefined s3.toUpperCase() //^? const s3: string ``` ### π Expected behavior `s3.toUpperCase()` shows type error. ### π Actual behavior `s3.toUpperCase()` shows no error. Note that `undefined` is correctly included inside the assignment statement but then lost. Related: https://github.com/microsoft/TypeScript/issues/40657