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

Unused variable warning for-loop #8147

Closed
markknol opened this issue Apr 11, 2019 · 5 comments
Closed

Unused variable warning for-loop #8147

markknol opened this issue Apr 11, 2019 · 5 comments
Assignees
Labels
enhancement feature-ide IDE / Editor support
Milestone

Comments

@markknol
Copy link
Member

for (i in 0...16) {
  trace("hello");
}

I get Warning: Unused variable

Would be nice to suppress this kind of errors, because there is no other alternative.

I tried underscore but that didn't help

for (_ in 0...16) {
  trace("hello");
}

Windows 10
Haxe 4.0.0-rc.2

@markknol markknol added enhancement feature-ide IDE / Editor support labels Apr 11, 2019
@Gama11
Copy link
Member

Gama11 commented Apr 11, 2019

Are you talking about diagnostics in FlashDevelop? In VSCode these are just grayed out instead of displaying as an actual warning.

Seems like this would need to be a setting on FD's end?

@markknol
Copy link
Member Author

markknol commented Apr 11, 2019

cc @SlavaRa Is there something HaxeDevelop can do here?

Some idea's from @Gama11 on the chat:

  • It should be easy for FD to check if the unused range is a _.

  • IMO unused code shouldn't be displayed as warnings to begin with, much nicer to gray it out

@SlavaRa
Copy link
Member

SlavaRa commented Apr 11, 2019

@markknol Hi, I'll be in the chat after the main job :)

@Simn Simn self-assigned this Apr 18, 2019
@Simn Simn added this to the Release 4.0 milestone Apr 18, 2019
@Simn
Copy link
Member

Simn commented Apr 18, 2019

Let's never warn about unused variables if the variable is named _.

@Simn Simn closed this as completed in c75f836 Apr 18, 2019
@markknol
Copy link
Member Author

Thanks! Nice solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature-ide IDE / Editor support
Projects
None yet
Development

No branches or pull requests

4 participants