Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: Type name cannot be empty #3573

Closed
Jimbolino opened this issue Dec 10, 2019 · 2 comments · Fixed by #3574
Closed

AssertionError: Type name cannot be empty #3573

Jimbolino opened this issue Dec 10, 2019 · 2 comments · Fixed by #3574
Assignees
Labels
bug A crash in Phan, a recent change causing incorrect analysis results, etc.

Comments

@Jimbolino
Copy link

ERROR: While parsing lib/OpenCloud/Database/Resource/Configuration.php...
AssertionError: Type name cannot be empty in /home/jim/projects/phan/src/Phan/Language/Type.php:422
Stack trace:
#0 /home/jim/projects/phan/src/Phan/Language/Type.php(1392): Phan\Language\Type::make('\\', '', Array, false, 2)
#1 /home/jim/projects/phan/src/Phan/Language/UnionType.php(385): Phan\Language\Type::fromStringInContext('\\', Object(Phan\Language\Context), 2, Object(Phan\CodeBase))
#2 /home/jim/projects/phan/src/Phan/Language/Element/Comment/Builder.php(259): Phan\Language\UnionType::fromStringInContext('\\', Object(Phan\Language\Context), 2, Object(Phan\CodeBase))
#3 /home/jim/projects/phan/src/Phan/Language/Element/Comment/Builder.php(633): Phan\Language\Element\Comment\Builder->returnTypeFromCommentLine('* @return \\@std...', 3)
#4 /home/jim/projects/phan/src/Phan/Language/Element/Comment/Builder.php(393): Phan\Language\Element\Comment\Builder->maybeParseReturn(3, '* @return \\@std...')
#5 /home/jim/projects/phan/src/Phan/Language/Element/Comment/Builder.php(320): Phan\Language\Element\Comment\Builder->parseCommentLine(3, '* @return \\@std...')
#6 /home/jim/projects/phan/src/Phan/Language/Element/Comment.php(411): Phan\Language\Element\Comment\Builder->build()
#7 /home/jim/projects/phan/src/Phan/Language/Element/Method.php(515): Phan\Language\Element\Comment::fromStringInContext('/**\n     * Gene...', Object(Phan\CodeBase), Object(Phan\Language\Context), 68, 5)
#8 /home/jim/projects/phan/src/Phan/Parse/ParseVisitor.php(314): Phan\Language\Element\Method::fromNode(Object(Phan\Language\Context), Object(Phan\CodeBase), Object(ast\Node), Object(Phan\Language\FQSEN\FullyQualifiedMethodName), Object(Phan\Language\Element\Clazz))
#9 /home/jim/projects/phan/src/Phan/Analysis.php(187): Phan\Parse\ParseVisitor->visitMethod(Object(ast\Node))
#10 /home/jim/projects/phan/src/Phan/Analysis.php(214): Phan\Analysis::parseNodeInContext(Object(Phan\CodeBase), Object(Phan\Language\Context), Object(ast\Node))
#11 /home/jim/projects/phan/src/Phan/Analysis.php(214): Phan\Analysis::parseNodeInContext(Object(Phan\CodeBase), Object(Phan\Language\Context), Object(ast\Node))
#12 /home/jim/projects/phan/src/Phan/Analysis.php(214): Phan\Analysis::parseNodeInContext(Object(Phan\CodeBase), Object(Phan\Language\Context), Object(ast\Node))
#13 /home/jim/projects/phan/src/Phan/Analysis.php(142): Phan\Analysis::parseNodeInContext(Object(Phan\CodeBase), Object(Phan\Language\Context), Object(ast\Node))
#14 /home/jim/projects/phan/src/Phan/Phan.php(207): Phan\Analysis::parseFile(Object(Phan\CodeBase), 'lib/OpenCloud/D...')
#15 /home/jim/projects/phan/src/phan.php(34): Phan\Phan::analyzeFileList(Object(Phan\CodeBase), Object(Closure))
#16 /home/jim/projects/phan/phan(2): require_once('/home/jim/proje...')
#17 {main}

steps to reproduce:
git clone git@github.com:rackspace/php-opencloud.git && cd php-opencloud && composer install --no-dev && phan --init
phan

phan version:

  • Phan 2.4.4
  • Phan 2.4.5-dev
@TysonAndre
Copy link
Member

A minimal example that reproduces this:

<?php

/**
 * @return \\@Test
 */
function test() {
}

@TysonAndre TysonAndre added the bug A crash in Phan, a recent change causing incorrect analysis results, etc. label Dec 10, 2019
@TysonAndre TysonAndre self-assigned this Dec 10, 2019
@TysonAndre
Copy link
Member

exclude_file_list and exclude_file_regex can be used to mitigate this, but a fix should be out by the end of the week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash in Phan, a recent change causing incorrect analysis results, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants