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

fix 'Call to a member function isAlias() on null', when processing Closure #2241

Merged
merged 1 commit into from
May 6, 2021

Conversation

guweigang
Copy link
Contributor

@guweigang guweigang commented May 6, 2021

Hello!

In raising this pull request, I confirm the following:

  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I updated the CHANGELOG

Small description of change:

My Env:

PHP 7.4.18
Zephir 0.13.4

Because of this, zephir generate command does not generate kernel and related c-header files.

PHP Error:

[06-May-2021 10:18:26 Asia/Chongqing] PHP Fatal error:  Uncaught Error: Call to a member function isAlias() on null in /home/guweigang/.config/composer/vendor/phalcon/zephir/Library/ClassMethod.php:2449
Stack trace:
#0 /home/guweigang/.config/composer/vendor/phalcon/zephir/Library/ClassMethod.php(2408): Zephir\ClassMethod->detectClassNameEntry()
#1 /home/guweigang/.config/composer/vendor/phalcon/zephir/Library/ClassMethod.php(2067): Zephir\ClassMethod->detectParam()
#2 /home/guweigang/.config/composer/vendor/phalcon/zephir/Library/ClassDefinition.php(1283): Zephir\ClassMethod->compile()
#3 /home/guweigang/.config/composer/vendor/phalcon/zephir/Library/CompilerFileAnonymous.php(106): Zephir\ClassDefinition->compile()
#4 /home/guweigang/.config/composer/vendor/phalcon/zephir/Library/CompilerFileAnonymous.php(201): Zephir\CompilerFileAnonymous->compileClass()
#5 /home/guweigang/.config/composer/vendor/phalcon/zephir/Library/Compiler.php(736): Zephir\CompilerFileAnonymous->compile()
#6 /home/guweigang/.config/composer/vendor/phalcon/zephir/Library/Console/Command/Gene in /home/guweigang/.config/composer/vendor/phalcon/zephir/Library/ClassMethod.php on line 2449

I debuged this, and get:

/home/guweigang/.config/composer/vendor/phalcon/zephir/Library/ClassMethod.php:2450:
string(9) "\Iterator"
/home/guweigang/.config/composer/vendor/phalcon/zephir/Library/ClassMethod.php:2450:
class Zephir\ClassDefinition#7285 (23) {
  protected string $namespace =>
  string(11) "phalconplus"
  protected string $shortName =>
  string(10) "2__closure"
  protected string $type =>
  string(5) "class"
  protected ?string $extendsClass =>
  ....

Thanks

…__closure' with zephir 0.13.4 and php 7.4.18
@codecov
Copy link

codecov bot commented May 6, 2021

Codecov Report

Merging #2241 (80029c4) into development (8d3141c) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@               Coverage Diff                @@
##             development   #2241      +/-   ##
================================================
- Coverage           7.67%   7.67%   -0.01%     
- Complexity          8702    8703       +1     
================================================
  Files                355     355              
  Lines              22061   22063       +2     
================================================
  Hits                1694    1694              
- Misses             20367   20369       +2     

@Jeckerson Jeckerson added the bug label May 6, 2021
@Jeckerson Jeckerson modified the milestones: 0.12.x, 0.13.5 May 6, 2021
@Jeckerson Jeckerson merged commit 3bf0986 into zephir-lang:development May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants