| library; | |
| import self as self; | |
| import "dart:core" as core; | |
| static method test1(core::int directCaptured) → dynamic/* scope=[ | |
| #ctx1: direct-captured [directCaptured], | |
| ] */ /* scope=[ | |
| #ctx2: not-captured [first,second], | |
| ] */ { | |
| late core::int first = let final core::int #t1 = directCaptured in let final void #t2 = directCaptured = #t1.{core::num::+}(1){(core::num) → core::int} in #t1; | |
| late core::int second = let final core::int #t3 = directCaptured in let final void #t4 = directCaptured = #t3.{core::num::+}(1){(core::num) → core::int} in #t3; | |
| return <core::int>[first, second, directCaptured]; | |
| } | |
| static method test2(core::int directCaptured) → dynamic/* scope=[ | |
| #ctx3: direct-captured [directCaptured], | |
| ] */ /* scope=[ | |
| #ctx4: not-captured [variable], | |
| ] */ { | |
| assert((() /* #ctx3 */ → core::bool => directCaptured =={core::num::==}{(core::Object) → core::bool} 0)(){() → core::bool}); | |
| late core::int variable = directCaptured; | |
| return variable; | |
| } | |
| static method test3(core::int assertCaptured) → dynamic/* scope=[ | |
| #ctx5: assert-captured [assertCaptured], | |
| ] */ { | |
| assert((() /* #ctx5 */ → core::bool /* scope=[ | |
| #ctx6: not-captured [isZero], | |
| ] */ { | |
| late core::bool isZero = assertCaptured =={core::num::==}{(core::Object) → core::bool} 0; | |
| return isZero; | |
| })(){() → core::bool}); | |
| } | |
| static method test4(core::int directCaptured) → dynamic/* scope=[ | |
| #ctx7: direct-captured [directCaptured], | |
| ] */ { | |
| if(directCaptured.{core::num::>}(0){(core::num) → core::bool})/* scope=[ | |
| #ctx8: not-captured [value], | |
| ] */ { | |
| late core::int value = let final core::int #t5 = directCaptured in let final void #t6 = directCaptured = #t5.{core::num::-}(1){(core::num) → core::int} in #t5; | |
| return value; | |
| } | |
| else/* scope=[ | |
| #ctx9: not-captured [assertIsZero], | |
| ] */ { | |
| function assertIsZero() /* #ctx7 */ → Null { | |
| assert(directCaptured =={core::num::==}{(core::Object) → core::bool} 0); | |
| } | |
| assertIsZero(){() → Null}; | |
| return 0; | |
| } | |
| } |