@@ -152,10 +152,10 @@ class GenericClassStringType
152152 return callOnType (PT_LC (" accepts" ), 2 , args);
153153 }
154154
155- /* the CompoundType callback; for a ConstantStringType yes under a mixed
156- * generic type, else the generic type 's (a StaticType's object type, a
157- * TemplateType's bound) verdict on its ObjectType, and'ed with maybe
158- * unless it is a class-string; the generic types' verdict for another
155+ /* the CompoundType callback; for a ConstantStringType the generic
156+ * type's (a StaticType's object type, a TemplateType's bound) verdict on
157+ * its ObjectType, and'ed with whether it is a class-string; the generic
158+ * types' verdict for another
159159 * GenericClassStringType; the verdict on ObjectWithoutClassType for a
160160 * ClassStringType; maybe for a StringType; no otherwise; UNDEF =
161161 * pending exception */
@@ -174,7 +174,6 @@ class GenericClassStringType
174174 zval *ownType = this ->type ();
175175 if (UNEXPECTED (ownType == NULL )) return zv::Val ();
176176 zv::Val genericType = zv::Val::copyOf (zv::Ref (ownType));
177- if (zv::Ref (genericType.raw ()).instanceOf (pt_ce_mixed_type)) return pt_type_is_super_type_of_result (PT_TRI_YES );
178177
179178 /* $genericType instanceof StaticType — the shadowing class */
180179 bool isStatic = zv::Ref (genericType.raw ()).instanceOf (pt_ce_static_type);
@@ -203,16 +202,12 @@ class GenericClassStringType
203202 }
204203 if (UNEXPECTED (isSuperType.isUndef ())) return zv::Val ();
205204
205+ /* $isSuperType->and(IsSuperTypeOfResult::createFromTrinaryLogic($type->isClassString())) */
206206 zend_long isClassString = pt_type_call_trinary (Z_OBJ_P (type), PT_LC (" isclassstring" ), 0 , NULL );
207207 if (UNEXPECTED (isClassString < 0 )) return zv::Val ();
208- if (isClassString != PT_TRI_YES ) {
209- /* $isSuperType->and(IsSuperTypeOfResult::createMaybe()) */
210- zv::Val maybe = pt_type_is_super_type_of_result (PT_TRI_MAYBE );
211- if (UNEXPECTED (maybe.isUndef ())) return zv::Val ();
212- isSuperType = pt_type_op (Z_OBJ_P (isSuperType.raw ()), PT_OP_AND , 1 , maybe.raw ());
213- }
214-
215- return isSuperType;
208+ zv::Val classStringResult = pt_type_is_super_type_of_result (isClassString);
209+ if (UNEXPECTED (classStringResult.isUndef ())) return zv::Val ();
210+ return pt_type_op (Z_OBJ_P (isSuperType.raw ()), PT_OP_AND , 1 , classStringResult.raw ());
216211 }
217212 if (instanceof_function (typeCe, pt_ce_generic_class_string_type)) {
218213 zval *other = typeOf (Z_OBJ_P (type));
0 commit comments