From 75521ea84c372460c4c8cd10450cd3645f8a6b10 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sat, 30 Nov 2024 23:34:05 +0800 Subject: [PATCH] Fix `Option::andThen` type inference --- phpunit.xml.dist | 2 +- tests/Option/data/option.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c60d461..99d7d66 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,6 @@ ', (new Some('car'))->and(new Some(true))); $option = (new Some(2))->andThen(static fn(int $number): Some => new Some((string) ($number ** 2))); -assertType('Nexus\Option\Some', $option); -assertType('numeric-string', $option->unwrap()); +assertType('Nexus\Option\Some', $option); +assertType('numeric-string&uppercase-string', $option->unwrap()); assertType('Nexus\Option\Some', (new Some(2))->or(new None())); assertType('Nexus\Option\Some', (new Some(2))->or(new Some('car')));