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

Vector.pop return value is not strongly typed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Adobe Flex SDK 4.5.1 (Release)
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Affected OS(s): All OS Platforms
      Language Found: English

      Description

      Consider we have the following code:

      function g(item:Sound):void {}
      function f():void {
      var v:Vector.<Sprite> = new Vector.<Sprite>();
      v.push(new Sprite());
      f(v.pop());
      }

      Here "v.pop()" type is clearly documented as T=Sprite, as in http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Vector.html#pop()
      But mxmlc doesn't complain about implicit type coercion.

      Actual Results:
      Runtime Coercion error

      Expected Results:
      Compile-time type check error

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: