Creating a new variable with the type "Object" means that it may be used to store any kind of object. This feature may be required in some specific
contexts, but it leaves the compiler unable to do any kind of type checking, and is therefore a hazardous practice.
Noncompliant code example
var obj:Object = new String(); // Noncompliant; Object used explicitly
var foo = new Object(); // Noncompliant; Object used explicitly
var bar = {name:String, age:int}; // Noncompliant; Object implicitly created
Compliant solution
var obj:String = new String();
var foo:IPortfolio = new Portfolio();
class Person {
public var name:String;
public var age:int;
}
var bar:Person = new Person();