Undeclared parameters are implicitly &quot;any&quot;.  You don&#x27;t need nearly this much code to break.  This is equivalently broken:<p>var x: any = {}; x.foo();<p>Here&#x27;s the typesafe way: <a href="http:&#x2F;&#x2F;tryflow.org&#x2F;#b5f826e03045f64084cfc74398270e85" rel="nofollow">http:&#x2F;&#x2F;tryflow.org&#x2F;#b5f826e03045f64084cfc74398270e85</a>