Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(class): fix class obj recv implicit function no position#2489

Merged
xushiwei merged 4 commits intogoplus:mainfrom
go-wyvern:implicit-fun-pos
Nov 26, 2025
Merged

fix(class): fix class obj recv implicit function no position#2489
xushiwei merged 4 commits intogoplus:mainfrom
go-wyvern:implicit-fun-pos

Conversation

@go-wyvern
Copy link
Member

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @go-wyvern, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a compiler bug related to class object receivers, specifically ensuring that implicit functions associated with these receivers are correctly assigned source code position information. This enhancement improves the accuracy of error reporting and internal compiler state. Additionally, a new test case has been added to bolster error detection for type redeclarations in .tspx files.

Highlights

  • Class Object Receiver Position: Corrected an issue where implicit function receivers for class objects were not assigned proper position information, ensuring better error reporting and internal consistency within the compiler.
  • New Error Test Case: Introduced a new test case in TestSpxError to validate the compiler's handling of type redeclaration errors across multiple .tspx files.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively resolves a nil pointer dereference panic that occurred when compiling class files with implicit functions. The fix correctly adds position information to the AST nodes for the implicit receiver (this), which was previously missing and caused the crash. The addition of a new test case that triggers the fixed code path is a good measure to prevent future regressions. The changes are clean, targeted, and correct.

@xgopilot
Copy link

xgopilot bot commented Nov 24, 2025

Code Review Summary

Overall Assessment: Well-executed bug fix that correctly adds position information to class receiver AST nodes, enabling accurate error reporting for type redeclaration scenarios.

Strengths:

  • Proper use of ast.NewIdentEx with ImplicitFun flag
  • Comprehensive test coverage validating the fix
  • Minimal, focused changes

Finding: One minor inconsistency with "this" identifier position tracking (see inline comment).

No performance, security, or documentation concerns identified.

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.97%. Comparing base (f8122de) to head (94e9547).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2489   +/-   ##
=======================================
  Coverage   93.97%   93.97%           
=======================================
  Files          34       34           
  Lines        9588     9589    +1     
=======================================
+ Hits         9010     9011    +1     
  Misses        413      413           
  Partials      165      165           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xushiwei xushiwei merged commit 63d8482 into goplus:main Nov 26, 2025
29 checks passed
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.

Defining interfaces with the same name as sprite will cause a panic

2 participants