Skip to content

Wrong arguments for type inferenced generic methods #912

@MaxGraey

Description

@MaxGraey

Example:

const arr: i32[] = [1, 2, 3, 4, 5, 6];

export function reduce1(): i32 {
  return arr.reduce<i32>((a, b) => a + b, 0);
}

export function reduce2(): i32 {
  return arr.reduce((a, b) => a + b, 0);
}

Output:

reduce1: 21
reduce2: 0

WebAssembly Studio Fiddle

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions