Skip to content

Match interpretation doesn't identify return type correctly #6257

@SamMousa

Description

@SamMousa

Bug report

Code snippet below says it all.

Code snippet that reproduces the problem

https://phpstan.org/r/15763c62-f472-4630-a655-0ba5044dd17d

<?php declare(strict_types = 1);

    function alwaysThrow(): never {
	match(true) {
		true => throw new \Exception(),
       };
    }
}

Expected output

None

Did PHPStan help you today? Did it make you happy in any way?

Yes it did!

Possible duplicate of, or at the very least related to #6251

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions