-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Syntax lookup: Warning decorator #350
Syntax lookup: Warning decorator #350
Conversation
Hm, so there's two ways to use a warning attribute... one for the module level, and one for the expression level. Might be good making that clear on how to do each of them. I am currently not sure if they look the same though. @IwanKaramazow any idea? |
@ryyppy yes, the different syntaxes seem to be working. I tried the following: @warning("-32")
let x = 0 // No warning here
let x = 1
let y = 0 // "unused value y" warning here
let y = 1 As with your comment on the Anything else to consider? |
Two separate pages are fine. Just let's make it clear that the decorator applies to an expression / module. |
@ryyppy PR updated, see what you think. Also, could I double check something? In the PR I wrote that the decorators are use to enable or disable warnings. Is it correct that they can enable warnings, or are they exclusively used for disabling warnings? |
You can do both: Enable ( |
Thanks @ryyppy I've made some tweaks, see what you think. |
My concern with issue is that this is a buggy feature which has its use case but very hard to implement it correctly. |
Syntax Lookup @@warning is documented now, so let's close this one off. |
Suggestion for #162
PR should be editable, please feel free edit.