You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php
use CuyZ\Valinor\MapperBuilder;
require 'vendor/autoload.php';
final class a {
/**
* @param array{a: int}|array<never, never> $a
*/
public function __construct(
public readonly array $a,
) {
}
}
(new MapperBuilder)->mapper()->map(a::class, []);
Throws:
PHP Fatal error: Uncaught CuyZ\Valinor\Mapper\TypeTreeMapperError: Could not map type `a`. An error occurred at path *root*: Cannot be empty and must be filled with a value matching type `array{a: int}|array<never, never>`. in /home/daniil/repos/valinor/src/Mapper/TypeTreeMapper.php:29
The text was updated successfully, but these errors were encountered:
danog
changed the title
Union of shaped array with empty array is not collapsed into all-optional array
Empty array is not supported
Dec 27, 2022
Throws:
The text was updated successfully, but these errors were encountered: