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

Compose stage detection is broken #10

Open
veewee opened this issue Jun 6, 2024 · 0 comments
Open

Compose stage detection is broken #10

veewee opened this issue Jun 6, 2024 · 0 comments

Comments

@veewee
Copy link
Owner

veewee commented Jun 6, 2024

Bug Report

Q A
BC Break no
Version 0.5.0

In https://github.com/veewee/reflecta/releases/tag/0.5.0, the templates on Lens and ISO were marked as covariant.
This breaks the psalm plugin that detects the parameter types in compose() for both lenses and isos.

Expected:

/**
 * @template A
 * @template B
 * @template C
 * @template D
 *
 * @param Lens<A,B> $lens1
 * @param Lens<C,C> $lens2
 * @param Lens<C,D> $lens3
 * @return Lens<A,D>
 *
 * @psalm-suppress InvalidArgument
 */
function it_knows_broken_composition(Lens $lens1, Lens $lens2, Lens $lens3): Lens
{
    return compose($lens1, $lens2, $lens3);
}

Yet, the InvalidArgument does not get triggered anymore. It is possibly not implemented in the dynamic function storage system.
To investigate and reactivate in the SA tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant