Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,17 @@ public function testNever(): void
$this->analyse([__DIR__ . '/data/arrow-function-never.php'], $errors);
}

public function testBug5206(): void
{
$errors = [];
if (PHP_VERSION_ID < 80000) {
$errors[] = [
'Parameter $mixed of anonymous function has invalid type Bug5206\mixed.',
9,
];
}

$this->analyse([__DIR__ . '/data/bug-5206.php'], $errors);
}

}
11 changes: 11 additions & 0 deletions tests/PHPStan/Rules/Functions/data/bug-5206.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php declare(strict_types = 1);

namespace Bug5206;

class HelloWorld
{
public function sayHello(): \Closure
{
return fn (mixed $mixed) => '`mixed` type!';
}
}
Loading