Skip to content

Commit 552d4cf

Browse files
committed
Test treatPhpDocTypesAsCertain with native union types
1 parent 6d35d29 commit 552d4cf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/PHPStan/Reflection/data/unionTypes.php

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace NativeUnionTypes;
44

5+
use function PHPStan\Analyser\assertNativeType;
56
use function PHPStan\Analyser\assertType;
67

78
class Foo
@@ -13,6 +14,7 @@ public function doFoo(int|bool $foo): self|Bar
1314
{
1415
assertType('bool|int', $foo);
1516
assertType('bool|int', $this->fooProp);
17+
assertNativeType('bool|int', $foo);
1618
}
1719

1820
}
@@ -25,6 +27,7 @@ class Bar
2527
function doFoo(int|bool $foo): Foo|Bar
2628
{
2729
assertType('bool|int', $foo);
30+
assertNativeType('bool|int', $foo);
2831
}
2932

3033
function (Foo $foo): void {

0 commit comments

Comments
 (0)