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

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

Issue 1195523002: Handle dynamic as bottom inside of function type reps (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Fix typo in comment Created 5 years, 6 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/constructors.js ('k') | test/codegen/expect/fieldtest.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 dart_library.library('covariance', null, /* Imports */[ 1 dart_library.library('covariance', null, /* Imports */[
2 "dart_runtime/dart", 2 "dart_runtime/dart",
3 'dart/core' 3 'dart/core'
4 ], /* Lazy imports */[ 4 ], /* Lazy imports */[
5 ], function(exports, dart, core) { 5 ], function(exports, dart, core) {
6 'use strict'; 6 'use strict';
7 let dartx = dart.dartx; 7 let dartx = dart.dartx;
8 let _t = Symbol('_t'); 8 let _t = Symbol('_t');
9 let Foo$ = dart.generic(function(T) { 9 let Foo$ = dart.generic(function(T) {
10 class Foo extends core.Object { 10 class Foo extends core.Object {
11 Foo() { 11 Foo() {
12 this[_t] = null; 12 this[_t] = null;
13 } 13 }
14 add(t) { 14 add(t) {
15 dart.as(t, T); 15 dart.as(t, T);
16 this[_t] = t; 16 this[_t] = t;
17 } 17 }
18 forEach(fn) { 18 forEach(fn) {
19 dart.as(fn, dart.functionType(dart.void, [T])); 19 dart.as(fn, dart.functionType(dart.void, [T]));
20 fn(this[_t]); 20 fn(this[_t]);
21 } 21 }
22 } 22 }
23 dart.setSignature(Foo, { 23 dart.setSignature(Foo, {
24 methods: () => ({ 24 methods: () => ({
25 add: [core.Object, [T]], 25 add: [dart.dynamic, [T]],
26 forEach: [core.Object, [dart.functionType(dart.void, [T])]] 26 forEach: [dart.dynamic, [dart.functionType(dart.void, [T])]]
27 }) 27 })
28 }); 28 });
29 return Foo; 29 return Foo;
30 }); 30 });
31 let Foo = Foo$(); 31 let Foo = Foo$();
32 class Bar extends Foo$(core.int) { 32 class Bar extends Foo$(core.int) {
33 Bar() { 33 Bar() {
34 super.Foo(); 34 super.Foo();
35 } 35 }
36 add(x) { 36 add(x) {
37 core.print(`Bar.add got ${x}`); 37 core.print(`Bar.add got ${x}`);
38 super.add(x); 38 super.add(x);
39 } 39 }
40 } 40 }
41 dart.setSignature(Bar, { 41 dart.setSignature(Bar, {
42 methods: () => ({add: [core.Object, [core.int]]}) 42 methods: () => ({add: [dart.dynamic, [core.int]]})
43 }); 43 });
44 function main() { 44 function main() {
45 let foo = new Bar(); 45 let foo = new Bar();
46 foo.add('hi'); 46 foo.add('hi');
47 } 47 }
48 dart.fn(main); 48 dart.fn(main);
49 // Exports: 49 // Exports:
50 exports.Foo$ = Foo$; 50 exports.Foo$ = Foo$;
51 exports.Foo = Foo; 51 exports.Foo = Foo;
52 exports.Bar = Bar; 52 exports.Bar = Bar;
53 exports.main = main; 53 exports.main = main;
54 }); 54 });
OLDNEW
« no previous file with comments | « test/codegen/expect/constructors.js ('k') | test/codegen/expect/fieldtest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698