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

Error BS1091 Incorrectly Flags "#if not <CONST>" #1158

Open
shortad opened this issue May 8, 2024 · 1 comment
Open

Error BS1091 Incorrectly Flags "#if not <CONST>" #1158

shortad opened this issue May 8, 2024 · 1 comment

Comments

@shortad
Copy link

shortad commented May 8, 2024

Pretty simple to test in any app, see the screenshot.

I've had one of these #if nots in our repo for a long time, but I did a quick sanity test too and verified that the Roku OS can process either if/else path successfully.

image

@shortad
Copy link
Author

shortad commented May 8, 2024

Line Source:

if (this.constants.has(nameLower)) {

Possible Fix (throwing this out there at 6:40am, so take with salt):

  case TokenKind.Identifier:
    // added replaceAll to remove 1 or more "not"
    const nameLower = token.text?.toLowerCase().replaceAll("not ", "");

    if (this.constants.has(nameLower)) {
      return !!this.constants.get(nameLower);
    }

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

No branches or pull requests

1 participant