diff --git a/src/Compiler/Expression.php b/src/Compiler/Expression.php index e71b198b..9699ad85 100644 --- a/src/Compiler/Expression.php +++ b/src/Compiler/Expression.php @@ -486,16 +486,16 @@ protected function passPropertyFetch(Node\Expr\PropertyFetch $expr) return new CompiledExpression(CompiledExpression::UNKNOWN); } elseif (!$scopeExpression->canBeObject()) { + $this->context->notice( + 'property-fetch-on-non-object', + "It's not possible to fetch a property on a non-object", + $expr, + Check::CHECK_BETA + ); + return new CompiledExpression(CompiledExpression::UNKNOWN); } - $this->context->notice( - 'property-fetch-on-non-object', - "It's not possible to fetch a property on a non-object", - $expr, - Check::CHECK_BETA - ); - return new CompiledExpression(CompiledExpression::UNKNOWN); }