Commit Graph

4 Commits

Author SHA1 Message Date
Vijay Menon 9da00a7add Add reporting of unimplemented conversions in generated code
R=sigmund@google.com

Review URL: https://chromereviews.googleplex.com/122037013
2014-11-21 13:52:10 -08:00
Vijay Menon 2116aa559b transitive inference test
We're currently getting the first var, but somehow not transitively.  If d1 is explicit typed, we don't see these dynamic invokes:

> dart ./bin/checker.dart -l info -o out tests/transitiveinfertest.dart
No issues found
#1: line 21, column 9 of tests/transitiveinfertest.dart: d1.c.b.a.x requires dynamic invoke
  print(d1.c.b.a.x);
        ^^^^^^^^^^
#2: line 21, column 9 of tests/transitiveinfertest.dart: d1.c.b.a requires dynamic invoke
  print(d1.c.b.a.x);
        ^^^^^^^^
#3: line 21, column 9 of tests/transitiveinfertest.dart: d1.c.b requires dynamic invoke
  print(d1.c.b.a.x);
        ^^^^^^

R=sigmund@google.com

Review URL: https://chromereviews.googleplex.com/120937013
2014-11-21 13:48:40 -08:00
Vijay Menon 8522221df4 Initial codegen skeleton
Invoke with:
> dart bin/checker.dart -o out tests/fieldtest.dart

Run with (node.js installed):
> node runtime/run.js runtime/dart_runtime.js runtime/dart_core.js out/fieldtest/fieldtest.dart.js fieldtest

Here's the output of fieldtest.dart.js:

var fieldtest;
(function (fieldtest) {
  // Class A
  var A = (function () {
    var _initializer = (function (_this) {
      _this.x = 42;
    });
    function A() {
      _initializer(this);
    }
    return A;
  })();
  fieldtest.A = A;

  // Function foo: (A) → void
  function foo(a) {
    dart_core.print(a.x);
  }
  fieldtest.foo = foo;

  // Function bar: (dynamic) → void
  function bar(a) {
    dart_core.print(dart_runtime.dload(a, "x"));
  }
  fieldtest.bar = bar;

  // Function main: () → void
  function main() {
    var a = new A();
    fieldtest.foo(a);
    fieldtest.bar(a);
  }
  fieldtest.main = main;

})(fieldtest || (fieldtest = {}));

R=sigmund@google.com

Review URL: https://chromereviews.googleplex.com/119897013
2014-11-20 12:15:55 -08:00
Vijay Menon 3f27060ad6 Initial checker 2014-11-17 08:50:19 -08:00