Skip to content

Commit e4b026a

Browse files
Add test
1 parent 3845338 commit e4b026a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/PHPStan/Rules/Classes/data/bug-13440.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,30 @@ public function test(Closure $cb): self
3535
return new self($this->val, $cb);
3636
}
3737
}
38+
39+
/**
40+
* @template TVal
41+
* @template TReturn
42+
*/
43+
class Box2
44+
{
45+
/**
46+
* @param TVal $val
47+
* @param callable(Foo<TVal>): TReturn $cb
48+
*/
49+
public function __construct(
50+
private mixed $val,
51+
private $cb,
52+
) {
53+
}
54+
55+
/**
56+
* @template TNewReturn
57+
* @param callable(Foo<TVal>): TNewReturn $cb
58+
* @return self<TVal, TNewReturn>
59+
*/
60+
public function test($cb): self
61+
{
62+
return new self($this->val, $cb);
63+
}
64+
}

0 commit comments

Comments
 (0)