Skip to content

add error messages on some call failures#984

Merged
fdupress merged 1 commit intomainfrom
fix-983
Apr 24, 2026
Merged

add error messages on some call failures#984
fdupress merged 1 commit intomainfrom
fix-983

Conversation

@fdupress
Copy link
Copy Markdown
Member

When using call with invariant on procedures whose argument or return types do not match, we raised an exception without catching it. This adds an error message.

Fix #983.

@fdupress
Copy link
Copy Markdown
Member Author

This needs improved further to print out at least the offending types. Ran out of time.

@fdupress fdupress requested a review from strub April 22, 2026 18:44
@fdupress fdupress self-assigned this Apr 22, 2026
@fdupress fdupress added the bug label Apr 22, 2026
@fdupress fdupress marked this pull request as ready for review April 23, 2026 14:11
@fdupress
Copy link
Copy Markdown
Member Author

@ahuelsing Are you happy with the error message? (This should address #983.)

Copy link
Copy Markdown
Contributor

@ahuelsing ahuelsing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@ahuelsing ahuelsing added this pull request to the merge queue Apr 23, 2026
@fdupress fdupress removed this pull request from the merge queue due to a manual request Apr 23, 2026
@fdupress
Copy link
Copy Markdown
Member Author

Big Pickle thinks the error message does not look like the other error messages in the code base and that it is a problem.

I agree with the first part (it is not like the other error messages in the codebase), but disagree that it is a problem. In fact, I am tempted to add a suggestion that call (: ... ==> ...) should be used so the relation between arguments/returns can be given explicitly.

I also think we should have a way of specifying contracts that allows us to avoid repeating the part that is invariant between pre and post. (But that should be a separate issue.)

@strub
Copy link
Copy Markdown
Member

strub commented Apr 24, 2026

@fdupress If you start to add detailed error messages and ask the question "hey, do you think this is in line with the current error messages?", of course you are going to obtain "no" as an answer. This should not forbid you to continue in this direction.

@fdupress
Copy link
Copy Markdown
Member Author

I was asking it about the format string and boxes :)

After I merge this, I'll start a general pass to improve our error messages to get an idea of what infra we could have to make it easier to write good ones throughout in the first place, then make a plan.

@alleystoughton
Copy link
Copy Markdown
Member

alleystoughton commented Apr 24, 2026

I was asking it about the format string and boxes :)

After I merge this, I'll start a general pass to improve our error messages to get an idea of what infra we could have to make it easier to write good ones throughout in the first place, then make a plan.

One of my recent favorites is apply saying:

the module Top.DDHOrAdv(Adv) is not allowed to use the modules(s) Adv

There was a missing module restriction. So the longer error message could at least say check your module restrictions for Adv.

When using call with invariant on procedures whose argument or return
types do not match, we raised an exception without catching it. This
adds an error message.
@fdupress fdupress enabled auto-merge April 24, 2026 17:09
@fdupress fdupress added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit dd9bd93 Apr 24, 2026
16 checks passed
@fdupress fdupress deleted the fix-983 branch April 24, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anomaly in call

4 participants