Skip to content

literal-string is non-empty-literal-string seems to be considered as always true #10911

@VincentLanglet

Description

@VincentLanglet

Hi, @orklah @weirdan

I was trying to fix #10909
and discovered an issue with conditional type which does block me.

https://psalm.dev/r/2d6c0230ed

 * @return (
 *    $s is non-empty-literal-string ? float : int
 * )

seems to give the same result than

 * @return (
 *    $s is literal-string ? float : int
 * )

like literal-string is non-empty-literal-string was always true...

This is the expected behavior https://phpstan.org/r/0ebe5412-7b05-4dd4-9ca3-2e5724c18c4f

Any idea where the fix need to be done ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions