@@ -137,4 +137,71 @@ public function testBug13049(): void
137137 $ this ->analyse ([__DIR__ . '/data/bug-13049.php ' ], []);
138138 }
139139
140+ #[RequiresPhp('>= 8.4 ' )]
141+ public function testBug12964 (): void
142+ {
143+ $ this ->analyse ([__DIR__ . '/data/bug-12964.php ' ], [
144+ [
145+ 'Template type X is declared as covariant, but occurs in contravariant position in property Bug12964\C::$b. ' ,
146+ 51 ,
147+ ],
148+ [
149+ 'Template type X is declared as covariant, but occurs in invariant position in property Bug12964\C::$d. ' ,
150+ 57 ,
151+ ],
152+ [
153+ 'Template type X is declared as contravariant, but occurs in covariant position in property Bug12964\D::$a. ' ,
154+ 65 ,
155+ ],
156+ [
157+ 'Template type X is declared as contravariant, but occurs in covariant position in property Bug12964\D::$c. ' ,
158+ 71 ,
159+ ],
160+ [
161+ 'Template type X is declared as contravariant, but occurs in invariant position in property Bug12964\D::$d. ' ,
162+ 74 ,
163+ ],
164+ [
165+ 'Template type X is declared as covariant, but occurs in invariant position in property Bug12964\E::$a. ' ,
166+ 82 ,
167+ ],
168+ [
169+ 'Template type X is declared as covariant, but occurs in invariant position in property Bug12964\E::$b. ' ,
170+ 85 ,
171+ ],
172+ [
173+ 'Template type X is declared as covariant, but occurs in invariant position in property Bug12964\E::$c. ' ,
174+ 88 ,
175+ ],
176+ [
177+ 'Template type X is declared as covariant, but occurs in invariant position in property Bug12964\E::$d. ' ,
178+ 91 ,
179+ ],
180+ [
181+ 'Template type X is declared as covariant, but occurs in contravariant position in property Bug12964\F::$b. ' ,
182+ 103 ,
183+ ],
184+ [
185+ 'Template type X is declared as covariant, but occurs in invariant position in property Bug12964\F::$d. ' ,
186+ 109 ,
187+ ],
188+ [
189+ 'Template type X is declared as contravariant, but occurs in covariant position in property Bug12964\G::$a. ' ,
190+ 118 ,
191+ ],
192+ [
193+ 'Template type X is declared as contravariant, but occurs in covariant position in property Bug12964\G::$c. ' ,
194+ 124 ,
195+ ],
196+ [
197+ 'Template type X is declared as contravariant, but occurs in invariant position in property Bug12964\G::$d. ' ,
198+ 127 ,
199+ ],
200+ [
201+ 'Template type X is declared as covariant, but occurs in invariant position in property Bug12964\H::$a. ' ,
202+ 136 ,
203+ ],
204+ ]);
205+ }
206+
140207}
0 commit comments