8040611a79
For every class, we now generate a setSignature call which attaches properties to the constructor recording the method signatures, the static function signatures, and the names of all of the static methods. This call also attaches a getter to every static method which returns the type of the function. Methods are only decorated with runtime types when torn off. At a tear-off, the type is looked up in the constructor, and then attached to the bound function. Top level functions and statement level functions get annotated with their type immediately after their declaration. We could consider moving all of the top level function annotations to the end of the file, but for now I've left it inline. Closures (function expressions) get wrapped in calls to a dart.fn helper, with type information attached in one of various forms. This is currently the least attractive part of this CL. We may want to iterate on the syntax for this. I've added some support for NSM checking to the dsend/dcall case as well. We may wish to iterate on the syntax, and on the runtime representation of types, but this should move us forward from a functionality standpoint. BUG= R=jmesserly@google.com, vsm@google.com Review URL: https://codereview.chromium.org/1138793002