Skip to content
Permalink
Browse files

Fix tokenising bug found while analysing Phan cc @TysonAndre

  • Loading branch information...
muglug committed Jun 28, 2019
1 parent caf7737 commit 62c37a84f294bf7575d28a857fbba3d79637102e
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/PropertyFetchAnalyzer.php
@@ -759,13 +759,20 @@ public static function analyzeInstance(
$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);
}
}
}

2 comments on commit 62c37a8

@TysonAndre

This comment has been minimized.

Copy link
Contributor

replied Jun 28, 2019

What was the comment triggering the bug?

@muglug

This comment has been minimized.

Copy link
Member Author

replied Jun 28, 2019

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