-
Notifications
You must be signed in to change notification settings - Fork 46
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
Using enums in ternary if statements has unused variable warnings when compiled #1091
Labels
bug
Something isn't working
Comments
Yeah, we need to improve the transpiled output to exclude those enums. Good catch. |
Any chance you'd be interested in trying to fix this? I think brighterscript/src/parser/Expression.ts Line 1381 in aa92cec
Lines 1189 to 1214 in aa92cec
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using enums to get values in a ternary if statement, the transpiled code will set the enums as params but it won't use them to get the results. Instead, it inserts the actual values directly in the return statements.
Example
Using the following enums:
This ternary operation:
Will be transpiled into the following code:
When compiled, there will be unused variable warnings because of the
ClosedCaptionsButtonSize
andThumbButtonSize
params.The text was updated successfully, but these errors were encountered: