Skip to content

TooManyTemplateParams errors with recent psalm #137

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

Closed
lazka opened this issue Feb 11, 2021 · 4 comments
Closed

TooManyTemplateParams errors with recent psalm #137

lazka opened this issue Feb 11, 2021 · 4 comments

Comments

@lazka
Copy link

lazka commented Feb 11, 2021

<?php
use MyCLabs\Enum\Enum;

/**
 * @method static Level __default()
 * @method static Level intOnly()
 * @method static Level full()
 *
 * @psalm-immutable
 */
class Level extends Enum
{
    private const __default = 'intOnly';
    private const intOnly = 'intOnly';
    private const full = 'full';
}

This now leads to

ERROR: TooManyTemplateParams - ../../myclabs/php-enum/src/Enum.php:54:21 - MyNameSpace\Level<T:MyCLabs\Enum\Enum as mixed> has too many template params, expecting 0 (see https://psalm.dev/184)
     * @psalm-param static<T>|T $value

Any ideas on how to work around this?

@lazka lazka changed the title Errors with recetn psalm Errors with recent psalm Feb 11, 2021
@lazka lazka changed the title Errors with recent psalm TooManyTemplateParams errors with recent psalm Feb 11, 2021
@mnapoli
Copy link
Member

mnapoli commented Feb 12, 2021

TBH I have no idea what this means! I am not really the person driving the psalm annotations, it's mostly contributed through pull requests 😅

Maybe @drealecs has an idea?

@jdreesen
Copy link
Contributor

Can this be closed now that #138 is merged?

@lazka
Copy link
Author

lazka commented Feb 15, 2021

Yes, looks good, thanks!

@mnapoli
Copy link
Member

mnapoli commented Feb 15, 2021

Thanks!

@mnapoli mnapoli closed this as completed Feb 15, 2021
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

3 participants