Skip to content
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

False positive "Illegal assignment from List<AggregateResult> to List<AggregateResult>" #6052

Closed
PawelWozniak opened this issue Feb 3, 2025 · 6 comments

Comments

@PawelWozniak
Copy link
Contributor

PawelWozniak commented Feb 3, 2025

Summary

I am getting the false positive error message "Illegal assignment from List<AggregateResult> to List<AggregateResult>" which itself is not logical as the two types are the same. There are no compile errors on save.

Steps To Reproduce:

Type this code in apex class

        List<AggregateResult> noOpContracts = [SELECT MAX(Contract_Without_Opportunity_Cnt_Number__c) NoOppMaxNumber
                                               FROM Contract
                                               WHERE Contract_Without_Opportunity_Cnt_Number__c != null];

Filed Contract_Without_Opportunity_Cnt_Number__c is a numeric value. I am searching for the highest value across all records.

Expected result

No error is shown as the two types are the same, and the compiler doesn't show errors.

Actual result

I am getting a confusing error.

Additional information

Image Image

Salesforce Extension Version in VS Code: 62.14.1

Salesforce CLI Version: @salesforce/cli/2.74.6 win32-x64 node-v22.13.1

OS and version: Windows 11

VS Code version: 1.96.4

Most recent version of the extensions where this was working:

@svc-idee-bot
Copy link
Collaborator

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@mingxuanzhangsfdx
Copy link
Member

Hi @PawelWozniak Thanks for reporting the issue. Could you try the steps below and see if the warnings get disappeared?

  1. delete the folder .sfdx/tools
  2. reload VSCode workspace
  3. after indexing completes, the warnings in the tab Problems should no longer exist.

Thank you.

@PawelWozniak
Copy link
Contributor Author

Hi @mingxuanzhangsfdx I have applied the steps as suggested. Even closed and opened VSCode again, but no changes. Still, I see the same problem on the list.

@daphne-sfdc
Copy link
Contributor

Can you run SFDX: Refresh SObject Definitions from the command palette and see if that makes the error go away?

@PawelWozniak
Copy link
Contributor Author

@daphne-sfdc Yes done that, output:

Starting SFDX: Refresh SObject Definitions

09:37:02.946 sf sobject definitions refresh
Processed 861 Standard sObjects
Processed 74 Custom sObjects
09:37:14.851 sf sobject definitions refresh
 ended with exit code 0

I waited a few minutes and no change, it is still shown.

Copy link

This issue has not received a response in 3 days. It will auto-close in 2 days unless a response is posted.

@github-actions github-actions bot added the stale label Feb 11, 2025
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants