Skip to content

Array.reduce doesn't work Β #44063

Closed as not planned
Closed as not planned
@ilchenkoArtem

Description

@ilchenkoArtem

Bug Report

πŸ”Ž Search Terms

Array.reduce
Array.reduce doesn't work

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about reduce

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

// We can quickly address your report if:
//  - The code sample is short. Nearly all TypeScript bugs can be demonstrated in 20-30 lines of code!
//  - It doesn't use external libraries. These are often issues with the type definitions rather than TypeScript bugs.
//  - The incorrectness of the behavior is readily apparent from reading the sample.
// Reports are slower to investigate if:
//  - We have to pare too much extraneous code.
//  - We have to clone a large repo and validate that the problem isn't elsewhere.
//  - The sample is confusing or doesn't clearly demonstrate what's wrong.

πŸ™ Actual behavior

TS throws error "This expression is not callable."

πŸ™‚ Expected behavior

TS should let me iterate through array (I tell it the type is either array of IBaseOption OR array of ISelectOption (not an array of mixed types). In any case the variable is an array and those methods should be callable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    UnactionableThere isn't something we can do with this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions