Skip to content
Permalink
Browse files

Allow templated static type in fleshOutType

  • Loading branch information...
muglug committed Jun 24, 2019
1 parent 2a1ed6c commit 4baa4d70d8b00f00dc108bd145f82c50c9ad45c8
@@ -773,11 +773,24 @@ function (PhpParser\Node\Arg $arg) {
);
}
if ($lhs_type_part instanceof Type\Atomic\TTemplateParam) {
$static_type = $lhs_type_part;
} elseif ($lhs_type_part instanceof Type\Atomic\TTemplateParamClass) {
$static_type = new Type\Atomic\TTemplateParam(
$lhs_type_part->param_name,
$lhs_type_part->as_type
? new Type\Union([$lhs_type_part->as_type])
: Type::getObject()
);
} else {
$static_type = $fq_class_name;
}
$return_type_candidate = ExpressionAnalyzer::fleshOutType(
$codebase,
$return_type_candidate,
$self_fq_class_name,
$fq_class_name,
$static_type,
$class_storage->parent_class
);
@@ -995,7 +995,7 @@ public static function getArrayVarId(
/**
* @param Type\Union $return_type
* @param string|null $self_class
* @param string|Type\Atomic\TNamedObject|null $static_class_type
* @param string|Type\Atomic\TNamedObject|Type\Atomic\TTemplateParam|null $static_class_type
*
* @return Type\Union
*/
@@ -1044,7 +1044,7 @@ public static function fleshOutType(
/**
* @param Type\Atomic &$return_type
* @param string|null $self_class
* @param string|Type\Atomic\TNamedObject|null $static_class_type
* @param string|Type\Atomic\TNamedObject|Type\Atomic\TTemplateParam|null $static_class_type
*
* @return Type\Atomic|array<int, Type\Atomic>
*/

0 comments on commit 4baa4d7

Please sign in to comment.
You can’t perform that action at this time.