OLD | NEW |
(Empty) | |
| 1 library; |
| 2 import self as self; |
| 3 import "dart:core" as core; |
| 4 import "dart:mock" as mock; |
| 5 |
| 6 class C<T extends core::Object> extends core::Object { |
| 7 field dynamic v = new self::Closure#C#v#function::•<self::C::T>(null); |
| 8 final field dynamic y = new self::Closure#C#y#function::•(null); |
| 9 static final field dynamic z = new self::Closure#C#z#function::•(null); |
| 10 constructor •() → void |
| 11 : super core::Object::•() |
| 12 ; |
| 13 } |
| 14 class Closure#C#v#function<T extends core::Object> extends core::Object implemen
ts core::Function { |
| 15 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
| 16 field mock::Context context; |
| 17 constructor •(final mock::Context context) → dynamic |
| 18 : self::Closure#C#v#function::context = context |
| 19 ; |
| 20 method call(dynamic x) → dynamic { |
| 21 "This is a temporary solution. In the VM, this will become an additional par
ameter."; |
| 22 final mock::Context #contextParameter = this.{self::Closure#C#v#function::co
ntext}; |
| 23 return x is self::Closure#C#v#function::T; |
| 24 } |
| 25 } |
| 26 class Closure#C#y#function extends core::Object implements core::Function { |
| 27 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
| 28 field mock::Context context; |
| 29 constructor •(final mock::Context context) → dynamic |
| 30 : self::Closure#C#y#function::context = context |
| 31 ; |
| 32 method call() → dynamic { |
| 33 "This is a temporary solution. In the VM, this will become an additional par
ameter."; |
| 34 final mock::Context #contextParameter = this.{self::Closure#C#y#function::co
ntext}; |
| 35 return "y"; |
| 36 } |
| 37 } |
| 38 class Closure#C#z#function extends core::Object implements core::Function { |
| 39 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
| 40 field mock::Context context; |
| 41 constructor •(final mock::Context context) → dynamic |
| 42 : self::Closure#C#z#function::context = context |
| 43 ; |
| 44 method call() → dynamic { |
| 45 "This is a temporary solution. In the VM, this will become an additional par
ameter."; |
| 46 final mock::Context #contextParameter = this.{self::Closure#C#z#function::co
ntext}; |
| 47 return "z"; |
| 48 } |
| 49 } |
| 50 class Closure#x#function extends core::Object implements core::Function { |
| 51 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
| 52 field mock::Context context; |
| 53 constructor •(final mock::Context context) → dynamic |
| 54 : self::Closure#x#function::context = context |
| 55 ; |
| 56 method call() → dynamic { |
| 57 "This is a temporary solution. In the VM, this will become an additional par
ameter."; |
| 58 final mock::Context #contextParameter = this.{self::Closure#x#function::cont
ext}; |
| 59 return "x"; |
| 60 } |
| 61 } |
| 62 static field dynamic x = new self::Closure#x#function::•(null); |
| 63 static method main() → dynamic { |
| 64 if(!new self::C::•<core::String>().v("")) |
| 65 throw "C<String>.v false on String"; |
| 66 if(new self::C::•<core::String>().v(0)) |
| 67 throw "C<String>.v true on int"; |
| 68 if(new self::C::•<core::String>().v(null)) |
| 69 throw "C<String>.v true on null"; |
| 70 if(new self::C::•<core::int>().v("")) |
| 71 throw "C<int>.v true on String"; |
| 72 if(!new self::C::•<core::int>().v(0)) |
| 73 throw "C<int>.v false on int"; |
| 74 if(new self::C::•<core::int>().v(null)) |
| 75 throw "C<int>.v true on null"; |
| 76 if(!"x".==(self::x.call())) |
| 77 throw "x"; |
| 78 if(!"y".==(new self::C::•<core::String>().y())) |
| 79 throw "y"; |
| 80 if(!"z".==(self::C::z.call())) |
| 81 throw "z"; |
| 82 } |
OLD | NEW |