@@ -1069,7 +1069,7 @@ public function dataUnion(): iterable
10691069 new ObjectWithoutClassType (new ObjectType ('A ' )),
10701070 ],
10711071 MixedType::class,
1072- 'mixed=implicit ' ,
1072+ 'mixed~int =implicit ' ,
10731073 ],
10741074 [
10751075 [
@@ -1125,7 +1125,7 @@ public function dataUnion(): iterable
11251125 new ObjectType ('InvalidArgumentException ' ),
11261126 ],
11271127 MixedType::class,
1128- 'mixed=implicit ' , // should be MixedType~Exception+InvalidArgumentException
1128+ 'mixed~Exception~InvalidArgumentException =implicit ' ,
11291129 ],
11301130 [
11311131 [
@@ -2262,6 +2262,36 @@ public function dataUnion(): iterable
22622262 'PHPStan\Fixture\ManyCasesTestEnum~PHPStan\Fixture\ManyCasesTestEnum::A ' ,
22632263 ];
22642264
2265+ yield [
2266+ [
2267+ new ObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , new UnionType ([
2268+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'A ' ),
2269+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'B ' ),
2270+ ])),
2271+ new UnionType ([
2272+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'C ' ),
2273+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'D ' ),
2274+ ]),
2275+ ],
2276+ ObjectType::class,
2277+ 'PHPStan\Fixture\ManyCasesTestEnum~(PHPStan\Fixture\ManyCasesTestEnum::A|PHPStan\Fixture\ManyCasesTestEnum::B) ' ,
2278+ ];
2279+
2280+ yield [
2281+ [
2282+ new ObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , new UnionType ([
2283+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'A ' ),
2284+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'B ' ),
2285+ ])),
2286+ new UnionType ([
2287+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'A ' ),
2288+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'D ' ),
2289+ ]),
2290+ ],
2291+ ObjectType::class,
2292+ 'PHPStan\Fixture\ManyCasesTestEnum~PHPStan\Fixture\ManyCasesTestEnum::B ' ,
2293+ ];
2294+
22652295 yield [
22662296 [
22672297 new ThisType (
@@ -4224,6 +4254,27 @@ public function dataIntersect(): iterable
42244254 '$this(stdClass)&stdClass::foo ' ,
42254255 ];
42264256
4257+ yield [
4258+ [
4259+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'A ' ),
4260+ new MixedType (false , new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'A ' )),
4261+ ],
4262+ NeverType::class,
4263+ '*NEVER*=implicit ' ,
4264+ ];
4265+
4266+ yield [
4267+ [
4268+ new UnionType ([
4269+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'A ' ),
4270+ new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'B ' ),
4271+ ]),
4272+ new MixedType (false , new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'A ' )),
4273+ ],
4274+ EnumCaseObjectType::class,
4275+ 'PHPStan\Fixture\ManyCasesTestEnum::B ' ,
4276+ ];
4277+
42274278 yield [
42284279 [
42294280 TypeCombinator::intersect (new StringType (), new AccessoryNonEmptyStringType ()),
0 commit comments