Skip to content

fix(classfile): include source in StructLit initialization for work classes #2417

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

Merged
merged 2 commits into from
Jul 24, 2025

Conversation

go-wyvern
Copy link
Member

@Copilot Copilot AI review requested due to automatic review settings July 24, 2025 07:09
Copy link

@Copilot 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 a bug in the genWorkClasses function where the source parameter was missing from StructLit initialization for work classes. The fix addresses issue #30 by ensuring that source information is properly included when creating struct literals.

  • Adds lookup of the class node source information using parent.lookupClassNode(spt)
  • Updates Val() calls to include the source parameter for both indexGame and recv
Comments suppressed due to low confidence (1)

cl/classfile.go:577

  • [nitpick] The variable name 'src' is too abbreviated and could be ambiguous. Consider using a more descriptive name like 'sourceNode' or 'classSource' to improve code readability.
		src := parent.lookupClassNode(spt)

@visualfc visualfc merged commit be8570a into goplus:main Jul 24, 2025
23 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.

struct called "Plat" will cause a crash
2 participants