From 633b210a32b2636e36cdbd6feb55c544222cfeb4 Mon Sep 17 00:00:00 2001 From: Brown Date: Sun, 12 Apr 2020 21:47:50 -0400 Subject: [PATCH] Fix test --- .../Internal/Analyzer/Statements/ExpressionAnalyzer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php index 5a69942e0..d3d0acee3 100644 --- a/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php @@ -1101,7 +1101,12 @@ class ExpressionAnalyzer $offset = 'static::' . $stmt->dim->name; } elseif ($stmt->dim && $source instanceof StatementsAnalyzer - && ($stmt_dim_type = $source->node_data->getType($stmt->dim))) { + && ($stmt_dim_type = $source->node_data->getType($stmt->dim)) + && (!$stmt->dim instanceof PhpParser\Node\Expr\ClassConstFetch + || !$stmt->dim->name instanceof PhpParser\Node\Identifier + || $stmt->dim->name->name !== 'class' + ) + ) { if ($stmt_dim_type->isSingleStringLiteral()) { $offset = '\'' . $stmt_dim_type->getSingleStringLiteral()->value . '\''; } elseif ($stmt_dim_type->isSingleIntLiteral()) {