-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
Bug Report
🔎 Search Terms generic type resolve
🕗 Version & Regression Information 4.4.0-dev.20210605
💻 Code
/** @template T @typedef {T | undefined} Option */
/** @type {<T1, T2>(x: Option<T1>, y: T2) => T1 | T2} */
const a = (x, y) => x !== undefined ? x : y
// Making 'number | undefined' value
/** @type {{ prop?: number }} */
const b = { prop: 1 }
const { prop } = b
// 4.3: number
// 4.4: number | undefined
const c = a(prop, 2)
🙁 Actual behavior
undefined
is a part of generic T1
🙂 Expected behavior
undefined
is excluded from generic T1
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created