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

Unified Diff: pkg/kernel/testcases/closures/type_variables.dart.expect

Issue 2561723003: Merge kernel closure conversion into the Dart SDK (Closed)
Patch Set: Remove path constraint Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: pkg/kernel/testcases/closures/type_variables.dart.expect
diff --git a/pkg/kernel/testcases/closures/type_variables.dart.expect b/pkg/kernel/testcases/closures/type_variables.dart.expect
new file mode 100644
index 0000000000000000000000000000000000000000..bf7dd96b0ee790fcc6942e819c4bb28f3dadeb24
--- /dev/null
+++ b/pkg/kernel/testcases/closures/type_variables.dart.expect
@@ -0,0 +1,88 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "dart:mock" as mock;
+
+class C<T extends core::Object, S extends core::Object> extends core::Object {
+ constructor internal() → void
+ : super core::Object::•()
+ ;
+ method foo(self::C::S s) → dynamic {
+ final mock::Context #context = new mock::Context::•(1);
+ #context.parent = null;
+ #context.[]=(0, this);
+ return new self::Closure#C#foo#function::•<self::C::T, self::C::S>(#context);
+ }
+ method bar() → dynamic {
+ self::C<self::C::T, self::C::S> self = this;
+ }
+ method baz() → dynamic {
+ return new self::Closure#C#baz#function::•<self::C::T, self::C::S>(null);
+ }
+ static factory •<T extends core::Object, S extends core::Object>() → self::C<self::C::•::T, self::C::•::S> {
+ final dynamic local = new self::Closure#C#function#local::•<self::C::•::T, self::C::•::S>(null);
+ return local.call();
+ }
+}
+class Closure#C#foo#function<T extends core::Object, S extends core::Object> extends core::Object implements core::Function {
+ field core::String note = "This is temporary. The VM doesn't need closure classes.";
+ field mock::Context context;
+ constructor •(final mock::Context context) → dynamic
+ : self::Closure#C#foo#function::context = context
+ ;
+ method call(self::Closure#C#foo#function::T x) → dynamic {
+ "This is a temporary solution. In the VM, this will become an additional parameter.";
+ final mock::Context #contextParameter = this.{self::Closure#C#foo#function::context};
+ self::Closure#C#foo#function::T y = x;
+ core::Object z = y;
+ self::C<self::Closure#C#foo#function::T, self::Closure#C#foo#function::S> self = #contextParameter.[](0);
+ return z as self::Closure#C#foo#function::T;
+ }
+}
+class Closure#C#baz#function#function<T extends core::Object, S extends core::Object> extends core::Object implements core::Function {
+ field core::String note = "This is temporary. The VM doesn't need closure classes.";
+ field mock::Context context;
+ constructor •(final mock::Context context) → dynamic
+ : self::Closure#C#baz#function#function::context = context
+ ;
+ method call() → dynamic {
+ "This is a temporary solution. In the VM, this will become an additional parameter.";
+ final mock::Context #contextParameter = this.{self::Closure#C#baz#function#function::context};
+ return self::C::•<self::Closure#C#baz#function#function::T, self::Closure#C#baz#function#function::S>();
+ }
+}
+class Closure#C#baz#function<T extends core::Object, S extends core::Object> extends core::Object implements core::Function {
+ field core::String note = "This is temporary. The VM doesn't need closure classes.";
+ field mock::Context context;
+ constructor •(final mock::Context context) → dynamic
+ : self::Closure#C#baz#function::context = context
+ ;
+ method call() → dynamic {
+ "This is a temporary solution. In the VM, this will become an additional parameter.";
+ final mock::Context #contextParameter = this.{self::Closure#C#baz#function::context};
+ return new self::Closure#C#baz#function#function::•<self::Closure#C#baz#function::T, self::Closure#C#baz#function::S>(#contextParameter);
+ }
+}
+class Closure#C#function#local<T extends core::Object, S extends core::Object> extends core::Object implements core::Function {
+ field core::String note = "This is temporary. The VM doesn't need closure classes.";
+ field mock::Context context;
+ constructor •(final mock::Context context) → dynamic
+ : self::Closure#C#function#local::context = context
+ ;
+ method call() → dynamic {
+ "This is a temporary solution. In the VM, this will become an additional parameter.";
+ final mock::Context #contextParameter = this.{self::Closure#C#function#local::context};
+ self::C<self::Closure#C#function#local::T, self::Closure#C#function#local::S> self = new self::C::internal<self::Closure#C#function#local::T, self::Closure#C#function#local::S>();
+ return self;
+ }
+}
+static method main(dynamic arguments) → dynamic {
+ core::print(self::C::•<core::String, core::String>().foo(null).call(arguments.first));
+ dynamic c = self::C::•<core::int, core::int>().baz().call().call();
+ if(!(c is self::C<core::int, core::int>))
+ throw "${c} fails type test 'is C<int, int>'";
+ if(c is self::C<core::String, core::String>) {
+ throw "${c} passes type test 'is C<String, String>'";
+ }
+ core::print(c);
+}
« no previous file with comments | « pkg/kernel/testcases/closures/type_variables.dart ('k') | pkg/kernel/testcases/closures/uncaptured_for_in_loop.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698