You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Paul Hardiman <pa...@hardiman.com> on 2015/06/12 17:37:37 UTC
* vs Object
Vector.<*> seems to cause abc byte code issues. Compiler seems happier with Vector.<Object>.
What’s the difference?
Ciao,
Paul Hardiman
RE: * vs Object
Posted by Frédéric THOMAS <we...@hotmail.com>.
>> What’s the difference?
Also something I forgot you could be interested in, even though it doesn't matter for Vector.
var undefinedValue:* = undefined; // returns undefined
var undefinedObject:Object = undefined; // returns null
but
vector.push(undefined);
objects.push(undefined)
Both insert null as the type vector checking and conversion seems to be on Object.
So, at the end, it seems there are no differences in the usage, both are equivalent to Vector.<Object>, personally , I still use Vector.<*> when I've got no idea what it will go inside (uint, int, Object, ...) and use Vector.<Object> when I don't don't the subtype but it is a matter of style, it won't make any differences as far as I'm aware of.
Frédéric THOMAS
----------------------------------------
> From: webdoublefx@hotmail.com
> To: users@flex.apache.org
> Subject: RE: * vs Object
> Date: Fri, 12 Jun 2015 18:03:49 +0100
>
>> Vector.<*> seems to cause abc byte code issues. Compiler seems happier with Vector.<Object>.
>
> What code and what error do you get ?
>
>> What’s the difference?
>
> * stands for: undeterminated type
> Object for: Object and therefore its subclasses, so, given 1 instanceof Object == true
>
> var vector:* = new Vector.<*>(); // will return a Vector.<*> even though vector is typed *
> var objects:Vector.<Object> = new Vector.<Object>();
>
> vector.push(1);
> vector.push(new Object());
>
> objects.push(1);
> objects.push(new Object());
>
> both work.
>
> Frédéric THOMAS
>
>
> ----------------------------------------
>> From: paul@hardiman.com
>> Subject: * vs Object
>> Date: Fri, 12 Jun 2015 11:37:37 -0400
>> To: users@flex.apache.org
>>
>> Vector.<*> seems to cause abc byte code issues. Compiler seems happier with Vector.<Object>.
>> What’s the difference?
>>
>> Ciao,
>> Paul Hardiman
>>
>>
>>
>
RE: * vs Object
Posted by Frédéric THOMAS <we...@hotmail.com>.
> Vector.<*> seems to cause abc byte code issues. Compiler seems happier with Vector.<Object>.
What code and what error do you get ?
> What’s the difference?
* stands for: undeterminated type
Object for: Object and therefore its subclasses, so, given 1 instanceof Object == true
var vector:* = new Vector.<*>(); // will return a Vector.<*> even though vector is typed *
var objects:Vector.<Object> = new Vector.<Object>();
vector.push(1);
vector.push(new Object());
objects.push(1);
objects.push(new Object());
both work.
Frédéric THOMAS
----------------------------------------
> From: paul@hardiman.com
> Subject: * vs Object
> Date: Fri, 12 Jun 2015 11:37:37 -0400
> To: users@flex.apache.org
>
> Vector.<*> seems to cause abc byte code issues. Compiler seems happier with Vector.<Object>.
> What’s the difference?
>
> Ciao,
> Paul Hardiman
>
>
>