Skip to content

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Feb 6, 2024

if len(args) > 2:
fail("Up to 2 critical section variables are supported")
fail("Only 2 critical section variables are supported; "
f"{len(args)} was given")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
f"{len(args)} was given")
f"{len(args)} were given")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps also print them out?

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@erlend-aasland
Copy link
Contributor Author

@sobolevn, feel free to contribute to this branch/PR.

Comment on lines 838 to 839
fail("Cannot specify multiple varargs; "
f"'*{parameters[vararg].name}' was already provided as parameter {vararg+1}")
Copy link
Member

@serhiy-storchaka serhiy-storchaka Feb 6, 2024

Choose a reason for hiding this comment

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

You refer to the same parameter by the name and the number.
But the conflict is between two varargs parameters[vararg].name (number vararg+1) and p.name (number i).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps the number is not needed. I agree it is better if we refer to both parameters by name.

@erlend-aasland
Copy link
Contributor Author

Perhaps 94e082e is overdoing it.

@erlend-aasland
Copy link
Contributor Author

I'll have to start this branch over again; closing.

@erlend-aasland erlend-aasland deleted the clinic/better-error-messages branch October 15, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants