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
Invalid ImplementedReturnTypeMismatch #2556
Labels
Comments
I found these snippets: https://psalm.dev/r/19b73ba81b<?php
/**
* @template Tk of array-key
* @template Tv
*
* @extends IteratorAggregate<Tk, Tv>
*/
interface Collection extends Countable, IteratorAggregate
{
/**
* @psalm-template Tu
*
* @psalm-param iterable<Tu> $iterable
*
* @psalm-return Collection<Tk, array{0: Tv, 1: Tu}>
*/
public function zip(iterable $iterable): Collection;
}
/**
* @template Tk of array-key
* @template Tv
*
* @extends Collection<Tk, Tv>
*/
interface AccessibleCollection extends Collection
{
/**
* @psalm-template Tu
*
* @psalm-param iterable<Tu> $iterable
*
* @psalm-return AccessibleCollection<Tk, array{0: Tv, 1: Tu}>
*/
public function zip(iterable $iterable): AccessibleCollection;
}
|
Can be simplified to /**
* @template T1
*/
interface C
{
/**
* @psalm-return C<array<int, T1>>
*/
public function zip(): C;
}
/**
* @template T2
* @extends C<T2>
*/
interface AC extends C
{
/**
* @psalm-return AC<array<int, T2>>
*/
public function zip(): AC;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have encountered a bug in the
ImplementedReturnTypeMismatch
checker while writing some code today 🙂the typing here is sane, i have even reimplemented the exact same interfaces in hack lang and was able to type check everything without errors, so this is most likely a psalm bug.
snippet : https://psalm.dev/r/19b73ba81b
hack sample :
hack type checker output :
The text was updated successfully, but these errors were encountered: