Failures generate a StrongModeError. Fixes#236. Partially addresses #238.
Some issues to do:
- We're too eager to throw a StrongModeError. E.g., <int>[] is List<String> will throw.
- We don't differentiate between implicit and explicit casts.
R=leafp@google.com
Review URL: https://codereview.chromium.org/1298893003 .
The dart runtime files are roughly split around functional boundaries. Comments at the top of each file describe the function of the library. I'm not sure that these are 100% right yet, but they're closer. We may want to iterate on the organization.
The main dart runtime file just re-exports various symbols from the sub-libraries. It has hard dependencies on the other runtime files, some of which have soft (lazy) dependencies on SDK files. The generated code now depends on dart and dartx as a imported libraries, rather than as top level symbols.
This CL also includes some new code to make type representations a bit better. This is mostly in the new types.js file, which makes all of the non-instance types (dynamic, bottom, void, function types) subtypes of a common representation type. Among other things, they now have the correct runtime type (core.Type). Some of the type code has been rationalized around this a bit, but there is more left to do here. The setSignature code in classes.js now also places the correct runtime type on nominal (instance) types. There are new tests in the runtime_tests.js file to test for this.
The static object method code that implements the Object methods has not yet been updated to dispatch on type representations. I will do that in a separate CL.
BUG=
R=jmesserly@google.com, vsm@google.com
Review URL: https://codereview.chromium.org/1182653002