Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeCombiner combines class-string which results in less-specific type #9680

Open
boesing opened this issue Apr 20, 2023 · 1 comment
Open
Labels

Comments

@boesing
Copy link
Contributor

boesing commented Apr 20, 2023

https://psalm.dev/r/36d67d45fb

refs: #9599

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/36d67d45fb
<?php

interface CallableObjectInterface
{
    public function __invoke(): void;
}

function callableFunction(): void
{}

/** @param class-string<CallableObjectInterface>|class-string<object&callable():void> $callable */
function takesClassStringOfEitherCallableObjectOrCallableFunction(string $callable): void
{
	/** @psalm-trace $callable */
}
Psalm output (using commit 5efddb4):

INFO: Trace - 14:0 - $callable: class-string

INFO: UnusedParam - 12:74 - Param callable is never referenced in this method

@boesing boesing changed the title class-string is being combined even tho it should not get combined TypeCombiner combines class-string which results in less-specific type Apr 20, 2023
@orklah orklah added the bug label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants