stan-dev/stanc3

[BUG] Array declaration no longer canonicalizes from deprecated format

Closed this issue · 1 comments

Current Behavior:

when I run this command on code with a deprecated array declaration:

stanc array-deprecation-error.stan --canonicalize=deprecations

it produces the error:

Syntax error in 'array-deprecation-error.stan', line 8, column 15 to column 16, parsing error:
   -------------------------------------------------
     6:  data {
     7:    int an_int;
     8:    int some_ints[an_int]; // problem here
                        ^
     9:  }
   -------------------------------------------------

";" expected after variable declaration.

Expected Behavior:

Convert deprecated code to:

data {
  int an_int;
  array[some_ints] int an_int; // problem here
}

Model Code

Model which exhibits the issue stanc3 v2.34.0 (Unix)

worked in a previous version (unsure which one)

// Please put your code here
data {
  int an_int;
  int some_ints[an_int]; // problem here
}

Environment:

Anything else:

Deprecations are only guaranteed to be formattable during the warning window and for one version after removal. For the array syntax that means you can use any compiler from 2.26-2.33, but not 2.34, as the code for handling the old syntax has been removed