Skip to content

Inconsistent behavior: operator+ & af:add #23

@jramapuram

Description

@jramapuram

af::add is throwing a convertible error if you pass in an &af::Array

let test2 = add(&a, &b).unwrap();
➜  arrayfire-rust git:(master) ✗ cargo run --example helloworld
   Compiling arrayfire v3.0.0 (file:///Users/jramapuram/projects/arrayfire-rust)
examples/helloworld.rs:39:17: 39:20 error: the trait `arrayfire::arith::Convertable` is not implemented for the type `&arrayfire::array::Array` [E0277]
examples/helloworld.rs:39     let test2 = add(&a, &b).unwrap();
                                          ^~~
examples/helloworld.rs:39:17: 39:20 help: run `rustc --explain E0277` to see a detailed explanation
examples/helloworld.rs:39:17: 39:20 error: the trait `arrayfire::arith::Convertable` is not implemented for the type `&arrayfire::array::Array` [E0277]
examples/helloworld.rs:39     let test2 = add(&a, &b).unwrap();
                                          ^~~
examples/helloworld.rs:39:17: 39:20 help: run `rustc --explain E0277` to see a detailed explanation
error: aborting due to 2 previous errors
Could not compile `arrayfire`.

However, operator+ seems to work just fine. This behaviour should be consistent & accept an &Array.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions