Not planned
Description
π Search Terms
"undefined", "void", "optional", "no arguments", "rules"
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about typescript
β― Playground Link
No response
π» Code
const fn1= (param: undefined | number) => {}
const fn2 = (param: undefined | number) => {}
π Actual behavior
fn1(undefined) // success
fn1() // fail
fn2(undefined) //success
fn2() // success
π Expected behavior
fn1(undefined) // success
fn1() // success
fn2(undefined) //success
fn2() // success
Additional information about the issue
No response
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
fatcerberus commentedon Dec 1, 2023
This is what optional parameters are for
jcalz commentedon Dec 1, 2023
Duplicate of #12400
typescript-bot commentedon Dec 4, 2023
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.