Skip to content

cl logicalClassOf: skip if class exists; rmSuffix => cutSuffixes: skip if empty; genAsMethod: use recv (maybe alias type); don't create non ptr recv logical class; logical class support NonClass check - #951

Merged
xushiwei merged 5 commits into
goplus:mainfrom
xushiwei:lcls
Oct 6, 2026

Conversation

@xushiwei

@xushiwei xushiwei commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.99%. Comparing base (f536b6b) to head (137b76f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cl/logical.go 81.25% 3 Missing ⚠️
cl/name.go 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #951      +/-   ##
==========================================
+ Coverage   87.97%   87.99%   +0.01%     
==========================================
  Files          23       23              
  Lines        2661     2665       +4     
==========================================
+ Hits         2341     2345       +4     
  Misses        320      320              
Flag Coverage Δ
llgo-tests 87.99% <90.90%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review summary

Clean refactor of the logical-class generator. The logicalClass wrapper struct is replaced by passing named/base directly, and logicalClassOf/newLogicalType now return (*types.Named, bool) with the call site in cl/func.go properly guarding on the ok flag. The rmSuffix → cutSuffixes change is a genuine bugfix: it no longer produces an empty string when the whole name equals a suffix. The Spelling → Expansion switch in cl/ctx.go aligns goNode with goNodePos.

Build: go build ./cl/... passes. Security and performance passes found no issues (the refactor removes an allocation per logical class and adds negative-result caching).

Main point: the behavior of newLogicalType changed from reusing an existing same-named package type to refusing (returning nil, false), but the surrounding doc comments still describe the old reuse behavior. See inline notes.

Comment thread cl/logical.go
Comment thread cl/ctx.go
@xushiwei xushiwei changed the title cl logicalClassOf: skip if class exists; rmSuffix => cutSuffixes: skip if empty cl logicalClassOf: skip if class exists; rmSuffix => cutSuffixes: skip if empty; genAsMethod: use recv (maybe alias type) Oct 6, 2026
@xushiwei xushiwei changed the title cl logicalClassOf: skip if class exists; rmSuffix => cutSuffixes: skip if empty; genAsMethod: use recv (maybe alias type) cl logicalClassOf: skip if class exists; rmSuffix => cutSuffixes: skip if empty; genAsMethod: use recv (maybe alias type); don't create non ptr recv logical class Oct 6, 2026
@xushiwei xushiwei changed the title cl logicalClassOf: skip if class exists; rmSuffix => cutSuffixes: skip if empty; genAsMethod: use recv (maybe alias type); don't create non ptr recv logical class cl logicalClassOf: skip if class exists; rmSuffix => cutSuffixes: skip if empty; genAsMethod: use recv (maybe alias type); don't create non ptr recv logical class; logical class support NonClass check Oct 6, 2026
@xushiwei
xushiwei merged commit f72fb49 into goplus:main Oct 6, 2026
4 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.

1 participant