Skip to content
Permalink
Browse files

Fix template handling when templating inside templated class

  • Loading branch information
muglug committed Dec 10, 2019
1 parent af63f87 commit 8494f02008264d1e9b217c63a820fd2e1762b2d1
@@ -231,6 +231,7 @@ private static function handleAtomicStandin(
$template_result,
$codebase,
$matching_atomic_type,
$calling_class,
$replace,
$add_upper_bound,
$depth + 1
@@ -811,6 +811,7 @@ public function replaceTemplateTypesWithStandins(
TemplateResult $template_result,
Codebase $codebase = null,
Type\Atomic $input_type = null,
?string $calling_class = null,
bool $replace = true,
bool $add_upper_bound = false,
int $depth = 0
@@ -198,6 +198,7 @@ public function replaceTemplateTypesWithStandins(
TemplateResult $template_result,
Codebase $codebase = null,
Atomic $input_type = null,
?string $calling_class = null,
bool $replace = true,
bool $add_upper_bound = false,
int $depth = 0
@@ -157,6 +157,7 @@ public function replaceTemplateTypesWithStandins(
TemplateResult $template_result,
Codebase $codebase = null,
Atomic $input_type = null,
?string $calling_class = null,
bool $replace = true,
bool $add_upper_bound = false,
int $depth = 0
@@ -193,7 +194,7 @@ public function replaceTemplateTypesWithStandins(
$template_result,
$codebase,
$input_type_param,
null,
$calling_class,
$replace,
$add_upper_bound,
$depth + 1
@@ -323,6 +323,7 @@ public function replaceTemplateTypesWithStandins(
TemplateResult $template_result,
Codebase $codebase = null,
Atomic $input_type = null,
?string $calling_class = null,
bool $replace = true,
bool $add_upper_bound = false,
int $depth = 0
@@ -343,7 +344,7 @@ public function replaceTemplateTypesWithStandins(
$template_result,
$codebase,
$input_type_param,
null,
$calling_class,
$replace,
$add_upper_bound,
$depth
@@ -118,6 +118,7 @@ public function replaceTemplateTypesWithStandins(
TemplateResult $template_result,
Codebase $codebase = null,
Atomic $input_type = null,
?string $calling_class = null,
bool $replace = true,
bool $add_upper_bound = false,
int $depth = 0
@@ -153,7 +154,7 @@ public function replaceTemplateTypesWithStandins(
$template_result,
$codebase,
$input_type_param,
null,
$calling_class,
$replace,
$add_upper_bound,
$depth + 1
@@ -246,6 +246,7 @@ public function replaceTemplateTypesWithStandins(
TemplateResult $template_result,
Codebase $codebase = null,
Atomic $input_type = null,
?string $calling_class = null,
bool $replace = true,
bool $add_upper_bound = false,
int $depth = 0
@@ -266,7 +267,7 @@ public function replaceTemplateTypesWithStandins(
$template_result,
$codebase,
$input_type_param,
null,
$calling_class,
$replace,
$add_upper_bound,
$depth
@@ -2444,6 +2444,42 @@ class MyContainer extends Container {}
$a = (new MyContainer("hello"))->getAnother();',
],
'staticClassCreationIndirect' => [
'<?php
/**
* @template TKey as array-key
* @template TValue
*/
class Collection
{
private $arr;
/**
* @param array<TKey, TValue> $arr
*/
public function __construct(array $arr) {
$this->arr = $arr;
}
/**
* @template T1 as array-key
* @template T2
* @param array<T1, T2> $arr
* @return static<T1, T2>
*/
public static function getInstance(array $arr) {
return new static($arr);
}
/**
* @param array<TKey, TValue> $arr
* @return static<TKey, TValue>
*/
public function map(array $arr) {
return static::getInstance($arr);
}
}'
],
];
}

0 comments on commit 8494f02

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