-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Allow existing uses of _jacobian in function names, with warning #1471
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
In unrelated news, the following error is not detected until C++ compilation:
functions {
// void function
void foo_jacobian() {
jacobian += 1;
}
}
transformed data {
foo_jacobian();
}
@nhuurre good catch! so did this: functions {
void foo_rng(real x){
print(normal_rng(0,x));
}
}
model {
foo_rng(1.0);
} Fixed both. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void rngs are useless, but I suppose there's no harm in allowing them.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1471 +/- ##
==========================================
- Coverage 89.76% 89.67% -0.10%
==========================================
Files 63 63
Lines 10613 10656 +43
==========================================
+ Hits 9527 9556 +29
- Misses 1086 1100 +14
|
Closes #1470. This uses the basic rule that if the functions block contains no uses of the new
jacobian +=
statement, it is probably older code, so we should keep allowing it for now.Submission Checklist
Release notes
Fixed a backwards-compatiblity hazard with the new
_jacobian
functions. Existing functions that just happen to have this naming structure will no longer fail to compile, but will issue a warning alerting that this name will change meanings in the future.Copyright and Licensing
By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)