File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/test/php/lang/ast/unittest/emit Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,24 @@ public function run() {
256256 Assert::equals ('ok ' , $ f ('ok ' , 'test ' ));
257257 }
258258
259+ #[Test]
260+ public function partial_function_application_static_method () {
261+ $ f = $ this ->run ('use lang\ast\unittest\emit\Handle; class %T {
262+ private static function for($impl, $stream) {
263+ return match ($stream) {
264+ STDIN => new $impl(0),
265+ STDOUT => new $impl(1),
266+ STDERR => new $impl(2),
267+ };
268+ }
269+
270+ public function run() {
271+ return self::for(Handle::class, ?);
272+ }
273+ } ' );
274+ Assert::equals (new Handle (2 ), $ f (STDERR ));
275+ }
276+
259277 #[Test]
260278 public function partial_function_application_variadic () {
261279 $ f = $ this ->run ('class %T {
You can’t perform that action at this time.
0 commit comments