var result:Object = sendRequest();
var result:* = sendRequest();
It's fairly hard to Google for the explanation, but Subhash Chandra Gupta recently pointed me to a good example.
The full article can be found in the Flex 3 Help.
The difference is that * (an asterisk) signifies that the object can be any type and typing something as an Object will require you to cast if you are compiling in strict mode. Here's a greatly simplified example to demonstrate.
:Object {
return 1;
}
var one:Number = returnOne(); // compiler error in strict mode
:* {
return 2;
}
var two:Number = returnTwo(); // no compiler error in strict mode
So, it's like the ? wildcard matcher in Java Generics.
ReplyDelete