Skip to content

Some strange NEVER compatibility issue #4006

@b1rdex

Description

@b1rdex

https://phpstan.org/r/cbdc5e54-29b0-486f-9f5b-cac0e4366768

<?php declare(strict_types = 1);

interface foo {
	/**
	 * @return void
	 * @phpstan-return never
	 */
	public function bar();	
}

class bar implements foo {
	public function bar(): void {
		throw new \Exception();	
	}
}

Removing the native void return type fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions