Skip to content

fix(extgen): correct C param cast in class method wrapper calls#2436

Open
alexandre-daubois wants to merge 1 commit into
php:mainfrom
alexandre-daubois:extgen-type-fix
Open

fix(extgen): correct C param cast in class method wrapper calls#2436
alexandre-daubois wants to merge 1 commit into
php:mainfrom
alexandre-daubois:extgen-type-fix

Conversation

@alexandre-daubois
Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings May 18, 2026 13:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes class method wrapper generation so C arguments are cast based on each parameter type rather than the method return type.

Changes:

  • Adds a reusable template helper for class method wrapper call arguments.
  • Updates generated method wrapper calls to use the helper.
  • Adds tests covering scalar parameter casts across return types.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/extgen/templates/extension.c.tpl Refactors class method wrapper argument rendering through methodCallArg.
internal/extgen/cfile_phpmethod_test.go Adds coverage for class method parameter casting behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/extgen/templates/extension.c.tpl Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants