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

Incorrect type checking for truncations #2715

Closed
VMatthijs opened this issue Dec 19, 2018 · 2 comments
Closed

Incorrect type checking for truncations #2715

VMatthijs opened this issue Dec 19, 2018 · 2 comments

Comments

@VMatthijs
Copy link
Member

Summary:

The type checking for truncations in stanc2 does not always work.

Description:

Some models where the truncation bounds should be integers, get accepted even if the bounds are real.

Reproducible Steps:

Try to compile the model

model { 1 ~ bernoulli(0.2) T[0, 1.1]; }

Current Output:

This should throw a type checking error, as the 1.1 should be of type int.

Expected Output:

Instead, it compiles just fine.

Additional Information:

Provide any additional information here.

Current Version:

v2.18.0

@VMatthijs
Copy link
Member Author

This has been fixed in stanc3.

@mcol
Copy link
Contributor

mcol commented Feb 21, 2020

Yes, stanc3 reports the following:

Semantic error in 'test.stan', line 1, column 8 to column 37:
   -------------------------------------------------
     1:  model { 1 ~ bernoulli(0.2) T[0, 1.1]; }
                 ^
   -------------------------------------------------

Truncation is only defined if distribution has _lcdf and _lccdf functions implemented with appropriate signature.

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

No branches or pull requests

2 participants