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();
----


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
