-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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