Skip to content

Ill-formed print statements gets reported as Ill-formed reject statement #3365

@nsiccha

Description

@nsiccha

The MWE "should" (or should it?) error, but it errors in a weird way.

MWE:

transformed data {
    print(1:10);
}

Error:

┌ Error: Compilation failed!
│ Command: setenv(`make /home/niko/github/nsiccha/mwe/BridgeStan6/crash_model.so`; dir="/home/niko/.bridgestan/bridgestan-2.7.0")
│ stdout: 
│ --- Translating Stan model to C++ code ---
│ ./bin/stanc  --o=/home/niko/github/nsiccha/mwe/BridgeStan6/crash.hpp /home/niko/github/nsiccha/mwe/BridgeStan6/crash.stan
│ 
│ stderr: Syntax error in '/home/niko/github/nsiccha/mwe/BridgeStan6/crash.stan', line 2, column 11 to column 12, parsing error:
│    -------------------------------------------------
│      1:  transformed data {
│      2:      print(1:10);
│                     ^
│      3:  }
│    -------------------------------------------------
│ 
│ Ill-formed reject statement. After "reject(", we expect a comma separated list of either expressions or strings, followed by ");".
│ make: *** [Makefile:72: /home/niko/github/nsiccha/mwe/BridgeStan6/crash.hpp] Error 1
└ @ Main ~/github/nsiccha/mwe/BridgeStan6/crash.jl:9

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions