File tree Expand file tree Collapse file tree
tests/PHPStan/Rules/Properties Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1025,6 +1025,13 @@ public function testBug12250(): void
10251025 $ this ->analyse ([__DIR__ . '/data/bug-12250.php ' ], []);
10261026 }
10271027
1028+ public function testBug12688 (): void
1029+ {
1030+ $ this ->checkExplicitMixed = true ;
1031+ $ this ->checkImplicitMixed = true ;
1032+ $ this ->analyse ([__DIR__ . '/data/bug-12688.php ' ], []);
1033+ }
1034+
10281035 public function testBug4525 (): void
10291036 {
10301037 $ this ->analyse ([__DIR__ . '/data/bug-4525.php ' ], []);
Original file line number Diff line number Diff line change 1+ <?php // lint >= 8.1
2+
3+ namespace Bug12688 ;
4+
5+ /**
6+ * @template T = mixed
7+ */
8+ interface I {}
9+
10+ /**
11+ * @implements I<mixed>
12+ */
13+ enum E implements I
14+ {
15+ case E;
16+ }
17+
18+ /**
19+ * @template T
20+ */
21+ final class TemplateWithoutDefaultWorks
22+ {
23+ /**
24+ * @var I<T>
25+ */
26+ public readonly I $ i ;
27+
28+ /**
29+ * @param I<T> $i
30+ */
31+ public function __construct (I $ i = E::E)
32+ {
33+ $ this ->i = $ i ;
34+ }
35+ }
36+
37+ /**
38+ * @template T = mixed
39+ */
40+ final class TemplateWithDefaultDoesNotWork
41+ {
42+ /**
43+ * @var I<T>
44+ */
45+ public readonly I $ i ;
46+
47+ /**
48+ * @param I<T> $i
49+ */
50+ public function __construct (I $ i = E::E)
51+ {
52+ $ this ->i = $ i ;
53+ }
54+ }
You can’t perform that action at this time.
0 commit comments