Closed
Description
STR
Given the proper (commutative) Add
/Mul
implementations. (See this playpen link)
const I: Complex<f32> = Complex { re: 0., im: 1. };
let z = I * 3.; // OK
let z = I + 3.; // OK
let z = 3. * I; // Err
let z = 3. + I; // Err
Output
error: mismatched types: expected `_`, found `Complex<f32>` (expected floating-point variable, found struct Complex)
@nikomatsakis Could this work in the future? It would be great if could type 3. + 4. * I
instead of I * 4. + 3.
, the former feels more natural.