Rellum Rellum

S0114: cannot infer lambda parameter type

Generated from rellum-diagnostics/src/db.rs.

Explanation

Lambda parameter types can be inferred only from an expected function type, such as a generic function parameter T -> U. Without that context, the compiler cannot type-check the lambda body or choose the function type to lower.

Common causes

Canonical fixes

Before:

f = fn(x) => x + 1

After:

f = fn(x: Int) => x + 1

Before:

f = fn(x) => x * 2

After:

doubled = map(nums, fn(x) => x * 2)

Code example

f = fn(x) => x + 1