This changes the RestrictedTypeRules to eliminate a direct dependency on CheckerReporter. Instead of logging a missing type error with the reporter directly, it now calls an optional callback. The Checker registers an appropriate callback for its errors. Currently the code generators don't log these errors. This eliminates the dependency of the code generators on the checker reporter.
BUG=
R=jmesserly@google.com
Review URL: https://codereview.chromium.org/1067553004
During inference, allow sub-expressions of type dynamic to be cast to the inferred type.
This CL also adds special case support for the case where we are trying to infer a type for a closure literal with a fuzzy type - often these closures are already well-typed (or easily inferable) if we eliminate the fuzziness.
This gets rid of two of the static errors on angular hello world, along with most of the InferableClosure warnings (turning them into InferredTypeClosure infos).
Most of the remaining InferableClosure cases are function literals with block function bodies, which I don't handle in general yet.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1059763003
This records the actual point at which type inference fails and uses that to give a better error message. So where before we would say:
severe: line 76, column 38 of package:angular2/src/forms/directives.dart: [StaticTypeError] Type check failed: [c.validator, this.validator] (List<dynamic>) is not of type List<Function>
c.validator = validators.compose([c.validator, this.validator]);
we will now in addition say:
because c.validator cannot be typed as Function
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1056183002
cleaner since we only worry about it in one place, and the "this" check is easier and more precise now.
incidentally, I saw a CL go by on the V8 bug, looks like it's close to being fixed
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1052693004
essentially verify the expected HTML in the test
this tripped on an interesting issue, we have two ways of computing MD5 hashes that produce different answers. I left that as a TODO.
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1056613002
This is a first cut at downwards inference. The interaction with InferableLiteral etc isn't well sorted out yet, so while downwards inference on nested expressions works, there will currently be spurious warnings.
BUG=
R=vsm@google.com
Review URL: https://codereview.chromium.org/1038213003
* static methods qualified properly
* static method privacy is now enforced
* avoid static method names banned in strict mode
* avoid variable names banned in strict mode
We might want to relax privacy (for both instance and static), but for now it's nice and consistent with instance methods using ES6 Symbol
R=jacobr@google.com
Review URL: https://codereview.chromium.org/1034273003
Now running test.sh under Travis (actually script has been renamed to
`tool/build_and_test.sh` since it built and tested :). Keeping
`test.sh` as alias to build_and_test.sh in case people are used to
using it in the test directory.
Also removed `_visitOrEmpty` to resolve the following analyzer hint (so
that tests would pass):
> [hint] The method '_visitOrEmpty' is not used
(/Users/chalin/git/dev_compiler/lib/src/codegen/js_codegen.dart, line
2028, col 16)