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.
function returnOne():Object {
return 1;
}
var one:Number = returnOne(); // compiler error in strict mode
function returnTwo():* {
return 2;
}
var two:Number = returnTwo(); // no compiler error in strict mode
1 comment:
So, it's like the ? wildcard matcher in Java Generics.
Reply DeleteNote: Only a member of this blog may post a comment.
[フレーム]