Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: test/codegen/expect/covariance.js

Issue 1122883002: Do not suppress implicit constructors that need a super call. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/codegen/expect/cascade.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var covariance; 1 var covariance;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 let _t = Symbol('_t'); 4 let _t = Symbol('_t');
5 let Foo$ = dart.generic(function(T) { 5 let Foo$ = dart.generic(function(T) {
6 class Foo extends core.Object { 6 class Foo extends core.Object {
7 Foo() { 7 Foo() {
8 this[_t] = null; 8 this[_t] = null;
9 } 9 }
10 add(t) { 10 add(t) {
11 dart.as(t, T); 11 dart.as(t, T);
12 this[_t] = t; 12 this[_t] = t;
13 } 13 }
14 forEach(fn) { 14 forEach(fn) {
15 dart.as(fn, dart.functionType(dart.void, [T])); 15 dart.as(fn, dart.functionType(dart.void, [T]));
16 fn(this[_t]); 16 fn(this[_t]);
17 } 17 }
18 } 18 }
19 return Foo; 19 return Foo;
20 }); 20 });
21 let Foo = Foo$(); 21 let Foo = Foo$();
22 class Bar extends Foo$(core.int) { 22 class Bar extends Foo$(core.int) {
23 Bar() {
24 super.Foo();
25 }
23 add(x) { 26 add(x) {
24 core.print(`Bar.add got ${x}`); 27 core.print(`Bar.add got ${x}`);
25 super.add(x); 28 super.add(x);
26 } 29 }
27 } 30 }
28 // Function main: () → dynamic 31 // Function main: () → dynamic
29 function main() { 32 function main() {
30 let foo = new Bar(); 33 let foo = new Bar();
31 foo.add('hi'); 34 foo.add('hi');
32 } 35 }
33 // Exports: 36 // Exports:
34 exports.Foo$ = Foo$; 37 exports.Foo$ = Foo$;
35 exports.Foo = Foo; 38 exports.Foo = Foo;
36 exports.Bar = Bar; 39 exports.Bar = Bar;
37 exports.main = main; 40 exports.main = main;
38 })(covariance || (covariance = {})); 41 })(covariance || (covariance = {}));
OLDNEW
« no previous file with comments | « test/codegen/expect/cascade.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698