Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-16419

Variable declaration after using variable to be declared in Code Behind

    XMLWordPrintableJSON

Details

    Description

      Steps to reproduce:
      1. Create an application MXML file with code behind (e.g. sample.mxml with sample.as)
      2. Within a method of the sample.as, such as an initialization or button event add the following:

      strTest = "sample";

      // ... some code
      // add a listener to some object or read an application parameter

      var strTest:String = "aaa";

      3. Compile code from comandline.

      Actual Results:

      Compiles with no issues.

      Expected Results:

      Should NOT compile and provide a variable declaration error for the line containing:

      strTest = "sample";

      Workaround (if any):

      Be very carefull when programming with variables... this is a must fix for any real compilers (C++, .NET and Java would not compile).

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: