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

Syntax lookup: Warning decorator #350

Conversation

kevanstannard
Copy link
Contributor

Suggestion for #162

PR should be editable, please feel free edit.

@ryyppy
Copy link
Member

ryyppy commented May 11, 2021

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?

@kevanstannard
Copy link
Contributor Author

@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 @deprecated PR, what do you think about making these separate pages for Syntax Lookup?

Anything else to consider?

@ryyppy
Copy link
Member

ryyppy commented May 13, 2021

Two separate pages are fine. Just let's make it clear that the decorator applies to an expression / module.

@kevanstannard
Copy link
Contributor Author

@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?

@ryyppy
Copy link
Member

ryyppy commented May 15, 2021

Is it correct that they can enable warnings, or are they exclusively used for disabling warnings?

You can do both: Enable (@warning("+27")) or Disable (@warning("-27"))

@kevanstannard
Copy link
Contributor Author

Thanks @ryyppy

I've made some tweaks, see what you think.

@bobzhang
Copy link
Member

My concern with issue is that this is a buggy feature which has its use case but very hard to implement it correctly.

@kevanstannard
Copy link
Contributor Author

Syntax Lookup @@warning is documented now, so let's close this one off.

@kevanstannard kevanstannard deleted the syntax-lookup-warning-decorator branch September 2, 2021 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants