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

Give a hint if a user uses = operator wrong #254

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

bvdmitri
Copy link
Member

@bvdmitri bvdmitri commented Oct 2, 2024

This pull request introduces an error hint mechanism to guide users towards correct usage of the := operator when creating new random variables and adds a corresponding test to ensure this functionality works as expected.

Error hint mechanism:

  • src/GraphPPL.jl: Added an initialization function __init__ to register an error hint for MethodError when VariableRef is used incorrectly, suggesting the use of the := operator instead.

Testing:

  • test/model_macro_tests.jl: Added a test case to verify that the error hint is triggered when a VariableRef is used incorrectly with the = operator.

@wouterwln wouterwln merged commit c538d83 into main Oct 3, 2024
1 check passed
@wouterwln wouterwln deleted the error-hint-determentistic-mapping branch October 3, 2024 07:52
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.

2 participants