Skip to content

Add "array[] int, int" signature to infix operators + and - #3104

Open
@paul-buerkner

Description

@paul-buerkner

Description

When I try to add an array of integers and a single integer, I get the error:

Ill-typed arguments supplied to infix operator +. Available signatures: 
...
Instead supplied arguments of incompatible type: array[] int, int.

Is there a specific reason we don't have an array[] int, int signature for + and -?

Example

The following Stan code snippet will results in an error, but would be a well defined (vectorized) opteration I believe.

data {
  int N;
  array[N] int J;
}
transformed data {
  array[N] int K = J + N;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions