Skip to content

Endless loop when using generic instance #5211

@corphi

Description

@corphi

Given the snippet

<?php

/**
 * @psalm-template TKey of object
 * @psalm-template TValue
 * @template-extends SplObjectStorage<TKey, TValue>
 */
class ObjectStorage extends SplObjectStorage
{
}

$foo = new ObjectStorage();

Psalm endlessly ponders its last line, until it hits the memory_limit. The demo snippet https://psalm.dev/r/95d73fc1a4 has no output, because the worker supposedly crashes, too.

Current versions (tested with 4.4+) choke on it, but Psalm 3.18.2 does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions