mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Allow union with positive-int
This commit is contained in:
parent
be1cd5275e
commit
5dab45ce14
@ -44,6 +44,6 @@ class TLiteralInt extends TInt
|
||||
?string $this_class,
|
||||
bool $use_phpdoc_format
|
||||
): string {
|
||||
return $use_phpdoc_format ? 'int' : $this->value;
|
||||
return $use_phpdoc_format ? 'int' : (string) $this->value;
|
||||
}
|
||||
}
|
||||
|
@ -404,7 +404,8 @@ class Union implements TypeNode
|
||||
): string {
|
||||
$types = [];
|
||||
|
||||
$multi_ints = count($this->literal_int_types) > 1;
|
||||
$multi_ints = count($this->literal_int_types) > 1
|
||||
|| $this->hasPositiveInt();
|
||||
$multi_strings = count($this->literal_string_types) > 1;
|
||||
$multi_floats = count($this->literal_float_types) > 1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user