This is very half baked. Putting it down to work on better type literal support for the moment.
Qs:
(1) What should we measure? cast failures mapped back to source? I don't think we inject anything else right now.
(2) How should we report? I just have dump function right now, but that'll be unwieldy on large apps.
R=jacobr@google.com, jmesserly@google.com
Review URL: https://chromereviews.googleplex.com/146737013
We'll need to figure out an efficient way to do this in JS output.
An alternative, suggested by Jacob, is only provide something like an applyTruncated function. E.g., something like:
dynamic applyTruncated(Function f, List args) {
var arity = getArity(f);
assert(args.length >= arity.min);
args = args.sublist(0, arity.max);
return Function.apply(f, args);
}
Jacob: is this what you have in mind?
If so, we could *only* provide this. The dart2j impl could use the existing code pattern of is-checks. The ddc implementation could map to JS apply (with a check for named params?).
Thoughts?
R=jacobr@google.com
Review URL: https://chromereviews.googleplex.com/137047014
- bin/
devc.dart
- lib/
devc.dart
src/
info.dart # static info we compute, used by checker & backends
checker/ # implementation details for the checker
checker.dart # checking algorithm
rules.dart # type checking rules
resolver.dart # same as today, type resolution via analyzer
emitter/
...
- test/
checker/ # unit tests for the checker internals
codegen/ # left as is - maybe should rename to emitter?
samples/ # stand alone samples that we run in the end_to_end tests.
...
R=vsm@google.com
Review URL: https://chromereviews.googleplex.com/128957013