Skip to main content
July 28, 2014
Question

Vector contents not being type-checked ?

  • July 28, 2014
  • 1 reply
  • 316 views

Hi,

I found this post saying it was fixed (Peter Farland)

Vector contents not being type-checked by new compiler?

But the bug seems back.

For example, this should not compile:

var v:Vector.<Bitmap> = new Vector.<Bitmap>;

v.push(new Bitmap());

v[0].varThatDoesNotExistInBitmap = true; // Should not compile

Runtime error :

Error #1056: Cannot create property varThatDoesNotExistInBitmap on flash.display.Bitmap

Thx

This topic has been closed for replies.

1 reply

Participating Frequently
August 6, 2014

From the online reference for Vector.push():

          "Because this function can accept multiple arguments, the data type of the arguments is not checked at compile time even in strict           mode. However, if an argument is passed that is not an instance of the base type, an exception occurs at run time."


At least that works as documented.