@@ -919,7 +919,7 @@ public function dataAccepts(): array
919919),
920920TrinaryLogic::createYes (),
921921],
922- 'maybe accepts template-of-union sub type of a union member ' => [
922+ 'accepts template-of-union sub type of a union member ' => [
923923new UnionType ([
924924TemplateTypeFactory::create (
925925TemplateTypeScope::createWithClass ('Foo ' ),
@@ -941,6 +941,30 @@ public function dataAccepts(): array
941941]),
942942TemplateTypeVariance::createInvariant (),
943943),
944+ TrinaryLogic::createYes (),
945+ ],
946+ 'maybe accepts template-of-union sub type of a union member (argument) ' => [
947+ new UnionType ([
948+ TemplateTypeFactory::create (
949+ TemplateTypeScope::createWithClass ('Foo ' ),
950+ 'T ' ,
951+ new UnionType ([
952+ new IntegerType (),
953+ new FloatType (),
954+ ]),
955+ TemplateTypeVariance::createInvariant (),
956+ )->toArgument (),
957+ new NullType (),
958+ ]),
959+ TemplateTypeFactory::create (
960+ TemplateTypeScope::createWithClass ('Bar ' ),
961+ 'T ' ,
962+ new UnionType ([
963+ new IntegerType (),
964+ new FloatType (),
965+ ]),
966+ TemplateTypeVariance::createInvariant (),
967+ ),
944968TrinaryLogic::createMaybe (),
945969],
946970'accepts template-of-string equal to a union member ' => [
@@ -961,7 +985,7 @@ public function dataAccepts(): array
961985),
962986TrinaryLogic::createYes (),
963987],
964- 'maybe accepts template-of-string sub type of a union member ' => [
988+ 'accepts template-of-string sub type of a union member ' => [
965989new UnionType ([
966990TemplateTypeFactory::create (
967991TemplateTypeScope::createWithClass ('Foo ' ),
@@ -979,6 +1003,24 @@ public function dataAccepts(): array
9791003),
9801004TrinaryLogic::createMaybe (),
9811005],
1006+ 'maybe accepts template-of-string sub type of a union member (argument) ' => [
1007+ new UnionType ([
1008+ TemplateTypeFactory::create (
1009+ TemplateTypeScope::createWithClass ('Foo ' ),
1010+ 'T ' ,
1011+ new StringType (),
1012+ TemplateTypeVariance::createInvariant (),
1013+ )->toArgument (),
1014+ new NullType (),
1015+ ]),
1016+ TemplateTypeFactory::create (
1017+ TemplateTypeScope::createWithClass ('Bar ' ),
1018+ 'T ' ,
1019+ new StringType (),
1020+ TemplateTypeVariance::createInvariant (),
1021+ ),
1022+ TrinaryLogic::createMaybe (),
1023+ ],
9821024'accepts template-of-union containing a union member ' => [
9831025new UnionType ([
9841026new IntegerType (),
0 commit comments