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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove USAGE part of error message when using main macro #55037

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

KristofferC
Copy link
Sponsor Member

I hit this error message and it felt someone was very angry at me 馃槩

@KristofferC KristofferC added the domain:error messages Better, more actionable error messages label Jul 5, 2024
@@ -620,11 +620,11 @@ const main = MyApp.main
"""
macro main(args...)
if !isempty(args)
error("USAGE: `@main` is expected to be used as `(@main)` without macro arguments.")
error("`@main` is expected to be used as `(@main)` without macro arguments.")
Copy link
Contributor

Choose a reason for hiding this comment

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

In the interest of taking advantage of semantic errors, can this throw(ArgumentError(..)) instead?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

I'm not sure what errors one typically throws in macro expansions. I'll just do the current change for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not really consistent across Base at the moment. When I reworked the error messages in Printf, I opted for ArgumentError because the error is about the arguments of a macro (see here). I guess this could change in the future though if/when macros get the fancy error messages Claire talked about at JuliaCon. I'll keep this in mind until then though.

@KristofferC KristofferC merged commit 2a8bdd0 into master Jul 12, 2024
6 of 8 checks passed
@KristofferC KristofferC deleted the kc/USAGE branch July 12, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:error messages Better, more actionable error messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants