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

improve error message for using unbound 'self' in macro #26946

Closed
comex opened this Issue Jul 10, 2015 · 1 comment

Comments

Projects
None yet
3 participants
@comex
Copy link
Contributor

comex commented Jul 10, 2015

I just mistakenly tried to naively use self in a macro (which is only invoked by a method taking self), and got the error:

 error: `self` is not available in a static method. Maybe a `self` argument is missing?

As described in #15682, failure is intended due to hygiene. However, the error message is inaccurate, because a macro body is not a static method. It should be changed to take this case into account.

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jan 12, 2017

Seems a bit vague without a test case. Closing, but feel free to reopen with more detail.

@brson brson closed this Jan 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.