Skip to content

Commit e2dc601

Browse files
committed
Test type errors
1 parent a8dc98b commit e2dc601

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/src/integration/closure.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@
1212

1313
assert(call_user_func($closure) === 'test');
1414
assert_exception_thrown($closure);
15+
16+
function take(\stdClass $rs): void { }
17+
18+
try {
19+
take($closure);
20+
} catch (\TypeError $e) {
21+
assert(str_starts_with($e->getMessage(), 'take(): Argument #1 ($rs) must be of type stdClass, RustClosure given, called in '));
22+
}

0 commit comments

Comments
 (0)