File tree 2 files changed +14
-1
lines changed
tests/type_declarations/union_types/variance
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Invalid property inheritance where one direction is valid and the other unresolved
3
+ --FILE--
4
+ <?php
5
+ class A {
6
+ public X |B $ prop ;
7
+ }
8
+ class B extends A {
9
+ public B $ prop ;
10
+ }
11
+ ?>
12
+ --EXPECTF--
13
+ Fatal error: Type of B::$prop must be X|B (as in class A) in %s on line %d
Original file line number Diff line number Diff line change @@ -966,7 +966,7 @@ inheritance_status property_types_compatible(
966
966
if (status1 == INHERITANCE_ERROR || status2 == INHERITANCE_ERROR ) {
967
967
return INHERITANCE_ERROR ;
968
968
}
969
- ZEND_ASSERT (status1 == INHERITANCE_UNRESOLVED && status2 == INHERITANCE_UNRESOLVED );
969
+ ZEND_ASSERT (status1 == INHERITANCE_UNRESOLVED || status2 == INHERITANCE_UNRESOLVED );
970
970
return INHERITANCE_UNRESOLVED ;
971
971
}
972
972
You can’t perform that action at this time.
0 commit comments