Closed
Description
π Search Terms
"noUncheckedIndexedAccess" "undefined"
π Version & Regression Information
5.4.2
β― Playground Link
π» Code
type Arr = string[]
type T1 = Arr[0]
// ^? type T1 = string
declare const arr: Arr
const t1 = arr[0]
// ^? const t1: string | undefined
π Actual behavior
behavior of noUncheckedIndexedAccess
is inconsistent.
π Expected behavior
The type obtained from type T1 = Arr[0]
should be string | undefined
.
Additional information about the issue
No response