Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target should be reserved keyword #2679

Closed
VMatthijs opened this issue Oct 24, 2018 · 1 comment
Closed

Target should be reserved keyword #2679

VMatthijs opened this issue Oct 24, 2018 · 1 comment
Labels
Milestone

Comments

@VMatthijs
Copy link
Member

VMatthijs commented Oct 24, 2018

Summary:

Given its central role in the language, target should be a reserved keyword and should not be free to use as a variable.

Description:

target should only be usable to access (increment or read off) the log-density. We should not be overloading this critical key word.

Reproducible Steps:

Currently, the following is a valid Stan program

functions {
  vector target(vector y, vector theta, real[] x_r, int[] x_i) {
    vector[2] deltas;
    deltas[1] = y[1] - theta[1] - x_r[1];
    return deltas;
  }
}

It shouldn't be.

Current Output:

Parser does not complain.

Expected Output:

Parser complains about illegal use of target.

Additional Information:

(I would expect the same of get_lp, but I guess that's been deprecated.)

Current Version:

v2.18.0

@VMatthijs VMatthijs added the bug label Oct 24, 2018
@mcol
Copy link
Contributor

mcol commented Feb 8, 2020

Fixed in stanc3.

@mcol mcol closed this as completed Feb 8, 2020
@mcol mcol added this to the 2.22.0 milestone Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants