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

Psalm doesn't take into account method in child abstract class #3217

Closed
greg0ire opened this issue Apr 24, 2020 · 2 comments
Closed

Psalm doesn't take into account method in child abstract class #3217

greg0ire opened this issue Apr 24, 2020 · 2 comments
Labels

Comments

@greg0ire
Copy link
Contributor

I feel Psalm should be able to figure this one out: https://psalm.dev/r/c47f94a631

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/c47f94a631
<?php

abstract class AbstractPlatform
{
}

abstract class PgPlatform extends AbstractPlatform
{
    public function methodParentDoesNotHave(): void
    {
    }
}

abstract class AbstractTestCase
{
    abstract public function createPlatform(): AbstractPlatform;
}

abstract class AbstractPostgresqlTestCase extends AbstractTestCase
{
    abstract public function createPlatform(): PgPlatform;
    
    public function testFoo(): void
    {
        $this->createPlatform()->methodParentDoesNotHave();
    }
}
Psalm output (using commit e1c6fcc):

ERROR: UndefinedMethod - 25:34 - Method AbstractPlatform::methodparentdoesnothave does not exist

@muglug muglug added the bug label Apr 24, 2020
@greg0ire greg0ire mentioned this issue Apr 25, 2020
16 tasks
@muglug muglug closed this as completed in aceaf6c May 3, 2020
@greg0ire
Copy link
Contributor Author

greg0ire commented May 3, 2020

Thanks!

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