Skip to content

Checking if constant is false returns "true" incorrectly #4182

@ultra0000

Description

@ultra0000

Problem Description

I've encountered an issue where if a defined constant is set to true, checking if it's false will return true, and then checking if it's set to true will also return true.

Happens on AIR version 51.3.1.1, happens on Windows. It might happen on Android too, I will check later.

Steps to Reproduce

  1. Set a constant to true. I'll be using CONFIG::test for this example.
  2. Add code like this somewhere:
!CONFIG::test
{
   trace("false");
}
CONFIG::test
{
   trace("true");
}
  1. Compile and run. You will see both messages if the CONFIG::test constant is set to true, and only the "false" message if it's set to false.

Known Workarounds

You can define another constant that is the opposite of the constant you're trying to define, such as CONFIG::not_test, set it to true and check that. Not very clean, though.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions