1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

Handle $var::method() in XHPAST linter

Test Plan: Didn't see a fatal in new test case.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4783
This commit is contained in:
vrana 2013-02-01 11:17:46 -08:00
parent cdb01f23a7
commit 8374dbc4e3
2 changed files with 7 additions and 2 deletions

View file

@ -340,7 +340,10 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
$statics = $root->selectDescendantsOfType('n_CLASS_STATIC_ACCESS');
foreach ($statics as $static) {
$name = $static->getChildOfType(0, 'n_CLASS_NAME');
$name = $static->getChildByIndex(0);
if ($name->getTypeName() != 'n_CLASS_NAME') {
continue;
}
if ($name->getConcreteString() == 'static') {
$this->raiseLintAtNode(
$name,

View file

@ -8,6 +8,8 @@ h(function /* ! */ () use ($c) {});
static::m();
1 ? 1 : 2;
1 ?: 2;
$a = 'stdClass';
$a::m();
~~~~~~~~~~
disabled:3:1
disabled:4:5
@ -15,4 +17,4 @@ disabled:5:3
disabled:6:3
disabled:7:3
disabled:8:1
disabled:10:1
disabled:10:1