PHPantom version
phpantom_lsp 0.8.0-dirty
Installation method
Pre-built binary from GitHub Releases
Operating system
Windows x86_64
Editor
VS Code
Bug description
PHPantom reports a type mismatch when int<0..max> is passed to a parameter typed as non-negative-int.
Expected: no diagnostic. int<0..max> is compatible with non-negative-int.
Actual: PHPantom reports Argument 1 ($count) expects non-negative-int, got int<0..max>.
Steps to reproduce
- Use any supported PHP version.
- Create a PHP file with:
<?php
/**
* @param non-negative-int $count
*/
function addCount(int $count): void
{
}
function test(array $items): void
{
addCount(count($items));
}
- Run diagnostics.
PHPantom reports:
12 Argument 1 ($count) expects non-negative-int, got int<0..max>
type_mismatch_argument
Error output or panic trace
.phpantom.toml
Additional context
This came from a PHPUnit-style call where count($actual) is passed to a method expecting non-negative-int.
Binary source
Originally observed in the VS Code extension v0.5.0. Reproduced with the extension-cached GitHub Releases binary
PHPantom version
phpantom_lsp 0.8.0-dirty
Installation method
Pre-built binary from GitHub Releases
Operating system
Windows x86_64
Editor
VS Code
Bug description
PHPantom reports a type mismatch when
int<0..max>is passed to a parameter typed asnon-negative-int.Expected: no diagnostic.
int<0..max>is compatible withnon-negative-int.Actual: PHPantom reports
Argument 1 ($count) expects non-negative-int, got int<0..max>.Steps to reproduce
PHPantom reports:
Error output or panic trace
.phpantom.toml
Additional context
This came from a PHPUnit-style call where
count($actual)is passed to a method expectingnon-negative-int.Binary source
Originally observed in the VS Code extension v0.5.0. Reproduced with the extension-cached GitHub Releases binary