Skip to content

Commit

Permalink
Fix Option::andThen type inference
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Nov 30, 2024
1 parent 5095d0c commit 75521ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory="build/.phpunit.cache"
colors="true"
Expand Down
4 changes: 2 additions & 2 deletions tests/Option/data/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function testOption(Option $option): void
assertType('Nexus\Option\Some<bool>', (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<numeric-string>', $option);
assertType('numeric-string', $option->unwrap());
assertType('Nexus\Option\Some<numeric-string&uppercase-string>', $option);
assertType('numeric-string&uppercase-string', $option->unwrap());

assertType('Nexus\Option\Some<int>', (new Some(2))->or(new None()));
assertType('Nexus\Option\Some<int>', (new Some(2))->or(new Some('car')));
Expand Down

0 comments on commit 75521ea

Please sign in to comment.