Skip to content

Commit 65ce959

Browse files
author
Maarten Staa
committed
Add failing test for first class callables.
1 parent ff44907 commit 65ce959

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/snapshot/function.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,22 @@ describe("Function tests", function () {
231231
);
232232
expect(ast).toMatchSnapshot();
233233
});
234+
235+
test("first class callable support", function () {
236+
expect(
237+
parser.parseEval(
238+
`
239+
$callable = strlen(...);
240+
$callable = $item->doSomething(...);
241+
$callable = $item::doSomething(...);
242+
$callable = Foo::doSomething(...);
243+
`,
244+
{
245+
parser: {
246+
version: "8.1",
247+
},
248+
}
249+
)
250+
).toMatchSnapshot();
251+
});
234252
});

0 commit comments

Comments
 (0)