Reify dynamic as bottom or Object as appropriate in the generated code.
For general function types, dynamic parameters become bottom, and all other uses of dynamic become Object.
For concrete function types (the rtti attached to function objects) dynamic parameters also become Object.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1148333003
When we tear off a method, replace the obj.foo.bind(obj) pattern with dart.tearoff(obj, 'foo'), and the dart.bind(exp, 'foo') pattern with dart.tearoff(exp, 'foo'). This helper does both the bind and attaches rtti.
This CL also stops binding of static methods when they are town off, since I think this is unnecessary.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1142293002
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
this avoids reloading file contents many times during a compile. `.contents.data` == bad!
also fixes#73, using Analyzer's LineInfo instead of FileSpan to avoid finding line breaks over and over
I did some manual testing on sunflower as well as diffing SDK messages before and after
The one baseline change (23 -> 22) seems more accurate than it was before.
R=vsm@google.com
Review URL: https://codereview.chromium.org/1141013002
This prunes out INFO messages by default - they end up being a substantial chunk of the payload in server mode. You can still serve them up by passing '-l ALL' or '-l INFO'.
R=leafp@google.com
Review URL: https://codereview.chromium.org/1126243004
Factored the load order logic into its own file, as it was easier to work with that way. We could definitely tweak the structure.
Also tried hoisting constants out to top level, but it's not quite ready yet, so splitting that work out into a separate CL.
(also fixes#152 about cleaning up lazyClass, and fixes#181 about static fields)
R=vsm@google.com
Review URL: https://codereview.chromium.org/1133593004
this was happening because we picked up an == operator from analyzer's Element
also adds an assert, because I took way too much time figuring out what the heck was happening there :)
R=vsm@google.com
Review URL: https://codereview.chromium.org/1139673005
readability regression, but fairly simple fix. looks okay in libraries with few imports, bad if they have a lot. ultimately I think this gets cleaned up as part of emitting modules + handling module lowering in JS codegen, see issue #34.
R=vsm@google.com
Review URL: https://codereview.chromium.org/1122133003
Tightens up some typing issues (mostly in the collections) to eliminate some casts and dynamic calls. Also adds inference through parenthesized expressions.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1122313002
This fixes all of the static errors from generating the SDK except those in the _interceptors library, and a set of errors associated with checks of the form (v is E) for generic type parameter E. Most of the fixes consist of adding missing generic parameters, or making overrides consistent. There are a few fixes to resolve issues around code that moved implicitly between hidden implementation classes and their public API classes, and some other miscellaneous fixes.
All of my changes are in the tool/input_sdk directory - the rest of the diff is generated code.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1112403004
static/top-levels don't need extension method, operator renames, or different slots* for private members
(static members are qualified by the static type, so they aren't ambiguous, e.g. Foo._foo and Bar._foo where Foo and Bar are in same/different libraries)
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1111863002