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

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

Issue 1117793002: add checks needed for covariant generics, and List<E> (Closed) Base URL: git@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/covariance.dart ('k') | test/codegen/expect/covariance.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 var covariance;
2 (function(exports) {
3 'use strict';
4 let _t = Symbol('_t');
5 let Foo$ = dart.generic(function(T) {
6 class Foo extends core.Object {
7 Foo() {
8 this[_t] = null;
9 }
10 add(t) {
11 dart.as(t, T);
12 this[_t] = t;
13 }
14 forEach(fn) {
15 dart.as(fn, dart.functionType(dart.void, [T]));
16 fn(this[_t]);
17 }
18 }
19 return Foo;
20 });
21 let Foo = Foo$();
22 class Bar extends Foo$(core.int) {
23 add(x) {
24 core.print(`Bar.add got ${x}`);
25 super.add(x);
26 }
27 }
28 // Function main: () → dynamic
29 function main() {
30 let foo = new Bar();
31 foo.add('hi');
32 }
33 // Exports:
34 exports.Foo$ = Foo$;
35 exports.Foo = Foo;
36 exports.Bar = Bar;
37 exports.main = main;
38 })(covariance || (covariance = {}));
OLDNEW
« no previous file with comments | « test/codegen/covariance.dart ('k') | test/codegen/expect/covariance.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698