-
Notifications
You must be signed in to change notification settings - Fork 167
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
Print values in assertion message of VariableLimiter #4519
Conversation
406ab90
to
054ba3f
Compare
I would prefer if we instead encouraged tools to consistently include such information in the assert-messages, instead of manually patching every assert-call. |
In that case #4482 could have been labeled Meanwhile, it does not hurt to print the values already in the assert message. I also tested in Dymola 2024 R1 where it now looks better (with the patch applied). |
No, we can't both encourage tools to include the information and at the same time explicitly embedding the information in the messages. If we are serious about encouraging tools, on the other hand, these are some asserts that should be reformulated in order to not come out ugly with tools that also provide details of the failed assert condition:
and many, many more. There is also this kind of message, which doesn't embed values, but which will still not look great with a tool that displays the failed assert condition (giving context to the automatically provided values):
|
In that case #4482 could have been labeled tool-issue. But it was not.
See again. This is exactly the assert message this PR was about. Anyway, closing. |
See #4399 for the general issue. |
See: modelica/ModelicaStandardLibrary#4519 and modelica/ModelicaStandardLibrary#4399 The reason for "may" is: - To not require the value to be duplicated, for cases such as: modelica/ModelicaStandardLibrary#4399 - Support even smarter debugging. I thought it was sufficiently important to make it normative.
Thanks for reminding. Citing your comments from there:
That's exactly what I did in this PR.
I consider this just as a small side note but not yet as general advice on tool-vendors to improve there debugging messages on assertions. If it would already be the case then #4482 had not been reported. So questions are
|
Fixes #4482.