Skip to content

Fix: [for cherry-picking] Updated the public SemanticModel value lookup - #206

Closed
qodo-code-review[bot] wants to merge 1 commit into
fix/class-member-bare-visibilityfrom
fix/remediation-de5b6510-aeb2bd
Closed

qodo-code-review[bot] wants to merge 1 commit into
fix/class-member-bare-visibilityfrom
fix/remediation-de5b6510-aeb2bd

Conversation

@qodo-code-review

@qodo-code-review qodo-code-review Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Fixed Findings

  • Filter class members from semantic value lookup

Automated fix from agentic review of #205

Qodo Logo

Summary by Sourcery

Bug Fixes:

  • Restrict semantic value lookup from returning class members unless the requested symbol is itself a class.

Summary by cubic

Fixes semantic value lookup so it no longer returns class members when the requested symbol isn't a class.

Written for commit 98f8110. Summary will update on new commits.

Review in cubic

@codeant-ai

codeant-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Skipping PR review because a bot author is detected.

If you want to trigger CodeAnt AI, comment @codeant-ai review to trigger a manual review.

@sourcery-ai

sourcery-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates SemanticModel value lookup to filter non-class members when traversing class scopes, preventing class members from being exposed as public semantic values while preserving class-symbol and parent-scope resolution.

Flow diagram for filtered semantic value lookup

flowchart TD
    A["Lookup name in current scope"] --> B{"Symbol found?"}
    B -- No --> C["Move to parent scope"]
    C --> A
    B -- Yes --> D{"Class scope?"}
    D -- No --> E["Return symbol"]
    D -- Yes --> F{"Symbol kind is Class?"}
    F -- Yes --> E
    F -- No --> C
Loading

File-Level Changes

Change Details Files
Restrict public semantic value lookup so class member symbols are not returned as ordinary lexical values.
  • Continue walking parent scopes when a class scope contains a non-class symbol with the requested name.
  • Allow class symbols themselves to remain discoverable from class scopes.
  • Preserve existing nearest-scope lookup behavior for non-class scopes.
crates/bamts-compiler/src/checker/binder.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@qodo-code-review qodo-code-review Bot closed this Sep 8, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@codeant-ai

codeant-ai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 98f8110e
Scan Time: 2026-09-08 04:52:56 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

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.

0 participants