M
Modular13mo ago
Helehex

how do you disambiguate function calls

also, can you disambiguate between these two:
fn __mul__(self, other: MY_SIMD[type,1]):
// splat multiply
fn __mul__(self, other: MY_SIMD[type,simd_width]):
// flat multiply
...

MY_SIMD[type,1]*MY_SIMD[type,1] // error: ambiguous call to '__mul__'
fn __mul__(self, other: MY_SIMD[type,1]):
// splat multiply
fn __mul__(self, other: MY_SIMD[type,simd_width]):
// flat multiply
...

MY_SIMD[type,1]*MY_SIMD[type,1] // error: ambiguous call to '__mul__'
i can call it splat_mul() instead
5 Replies
Helehex
Helehex12mo ago
it works for builtin simd maybe uses one function? implicit cast splat from SIMD[type, 1] to SIMD[type,simd_width] MLIR stuff?
Three chickens in the green bag
There’s no way for the compiler to determine which one you’re attempting to call, that’s why it’s ambiguous.
Helehex
Helehex12mo ago
how does mojo do it
Three chickens in the green bag
There’s plenty of things they do that users can’t do right now (take the Tuple as an example) but I guess this is probably a question for @Jack Clayton.
Jack Clayton
Jack Clayton12mo ago
I'm not sure what's happening here, can you show me what type and MY_SIMD implementations look like?
Want results from more Discord servers?
Add your server