-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
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
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug