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

Bugfix/issue 2044 ternary op result for mismatched types; fixes #2044 #2046

Merged

Conversation

bob-carpenter
Copy link
Contributor

Submisison Checklist

  • Run unit tests: ./runTests.py src/test/unit
  • Run cpplint: make cpplint
  • Declare copyright holder and open-source license: see below

Summary

Fix promotion in conditional operator in Stan language to match context.

Intended Effect

Fixes issue #2044 in which a generated var was being cast to double. Also reduces overpromotion in general for more efficiency when both arguments are scalar.

How to Verify

Unit tests plus compilability of test-models/good/validate_conditional_op_good.stan (this was broken in 2.11 tests)

Side Effects

No.

Documentation

n/a

Reviewer Suggestions

Anyone.

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

Mitzi Morris
Columbia University

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@syclik
Copy link
Member

syclik commented Sep 1, 2016

Jenkins, retest this please.

@syclik
Copy link
Member

syclik commented Sep 1, 2016

I verified that the unit test does compile using CmdStan!

@syclik
Copy link
Member

syclik commented Sep 1, 2016

Thanks, Bob. I looked through the code and it looks reasonable.

@syclik syclik added this to the v2.12.0 milestone Sep 1, 2016
@bob-carpenter
Copy link
Contributor Author

Great. The integration tests pass with the fixes Mitzi put in. We did the final review on my machine and I pushed some refactoring and doc and the revised model. Someone else should code review it, but it looked OK to both of us.

@syclik
Copy link
Member

syclik commented Sep 2, 2016

I took a look. If I stare at it long enough, I think I can understand it. Looks good. I'll merge once it passes tests on travis.

@syclik syclik merged commit 303cb32 into develop Sep 2, 2016
@syclik syclik deleted the bugfix/issue-2044-ternary-op-result-for-mismatched-types branch September 2, 2016 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants