Skip to content

feature: analyser - make int ranges generic #704

@bendavies

Description

@bendavies

Feature

Support the following code

Example

<?php declare(strict_types=1);

/**
 * @template T of positive-int
 *
 * @param T $start
 * @param int<T,max> $end
 */
function range(int $start, int $end): void
{
    if (0 === $end) {
        // Dead code that mago should be able to spot
        echo 'hello';
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: EnhancementRequest for additions or changes that improve existing functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions