1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Fix tokenising bug found while analysing Phan cc @TysonAndre

This commit is contained in:
Brown 2019-06-28 12:29:39 -04:00
parent caf7737bbe
commit 62c37a84f2

View File

@ -759,13 +759,20 @@ class PropertyFetchAnalyzer
$type_tokens = Type::tokenize((string)$class_property_type);
foreach ($type_tokens as &$type_token) {
if (isset($class_template_params[$type_token[0]])) {
$type_token[0] = $class_template_params[$type_token[0]];
$new_type_tokens = [];
foreach ($type_tokens as $type_token_map) {
if (isset($class_template_params[$type_token_map[0]])) {
$tokened = Type::tokenize($class_template_params[$type_token_map[0]]);
foreach ($tokened as $new_t) {
$new_type_tokens[] = [$new_t[0], $type_token_map[1]];
}
} else {
$new_type_tokens[] = $type_token_map;
}
}
$class_property_type = Type::parseTokens($type_tokens);
$class_property_type = Type::parseTokens($new_type_tokens);
}
}
}