Skip to content

Validation error when resolving generic with int & float type #837

@MaxGraey

Description

@MaxGraey

Minimal example

function is<T>(a: T, b: T): bool {
  return a == b;
}
assert(is(1, 1.0));

This example can't validate and produce output:

[wasm-validator error in function $start:main] 1 != 4: call param types must match, on 
[i32] (call $~main/is<f64>
 [i32] (i32.const 0)
 [f64] (f64.const 1)
)
(on argument 0)

  Error: Validate error
  ...

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