Skip to content

Conversation

@Frankdroid7
Copy link
Contributor

Dart says Constant variables can't be assigned a value., when you try to reassign a value to a const variable.

I feel a better error description should have been Constant variables can't be re-assigned a value.
This is because we are trying to re-assign it not assign it at this point. The assignment has already been done.

Thanks.

Screenshot 2024-10-24 at 12 27 37

@google-cla
Copy link

google-cla bot commented Oct 24, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service
Copy link

Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/391489

Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly.

Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR).

@copybara-service

This comment was marked as duplicate.

@mit-mit
Copy link
Member

mit-mit commented Nov 4, 2024

Hi @Frankdroid7 can you please take a look at the review feedback in https://dart-review.googlesource.com/c/sdk/+/391489 ?

@Frankdroid7
Copy link
Contributor Author

Constant variables can't be assigned a value after initialization.

Yes, we can go with this as the error message @mit-mit
Thanks.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/391489 has been updated with the latest commits from this pull request.

@bwilkerson
Copy link
Member

I'm not sure what happened, but this PR only has one commit that I can see. Copybara copied the same commit to the CL, so there are no changes between the first and second patches. Could you please try uploading the commit with your latest changes again?

@Frankdroid7
Copy link
Contributor Author

Frankdroid7 commented Nov 6, 2024 via email

@Frankdroid7
Copy link
Contributor Author

Pushed a new commit

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/391489 has been updated with the latest commits from this pull request.

1 similar comment
@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/391489 has been updated with the latest commits from this pull request.

@bwilkerson
Copy link
Member

Thanks! I left some additional comments on the CL (https://dart-review.googlesource.com/c/sdk/+/391489).

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/391489 has been updated with the latest commits from this pull request.

1 similar comment
@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/391489 has been updated with the latest commits from this pull request.

@Frankdroid7
Copy link
Contributor Author

Frankdroid7 commented Dec 24, 2024

I have pushed new commit, sorry for the late response.

I changed the version of macros from macros: '>=0.1.3-main.0 <0.1.4 TO macros: ^0.0.1 because when I ran dart run analyzer/tool/messages/generate.dart with macros: '>=0.1.3-main.0 <0.1.4, I got this error and suggesstion from the compiler.

Screenshot 2024-12-24 at 21 55 43

Thanks

@mit-mit
Copy link
Member

mit-mit commented Feb 18, 2025

Closing as assumed abondoned

@Frankdroid7
Copy link
Contributor Author

Hello @mit-mit please don't close it yet.

I'm not able to comment on Gerrit platform. The question asked by Brain Wilkerson on that platform (https://dart-review.googlesource.com/c/sdk/+/391489/6/pkg/analyzer/pubspec.yaml#16) has been answered by the comment I made above since December last year.

ls there a way I can comment there?

@mit-mit
Copy link
Member

mit-mit commented Feb 18, 2025

Got it. What happens if you go to https://dart-review.googlesource.com/create-account, enter the gmail associated with this review (ibu_____15@gmail.com), and then go to https://dart-review.googlesource.com/c/sdk/+/391489 ?

@Frankdroid7
Copy link
Contributor Author

Frankdroid7 commented Feb 18, 2025

@mit-mit that worked, I have replied to Brain's comment, thanks.

@mraleph
Copy link
Member

mraleph commented Feb 18, 2025

@mit-mit that worked, I have replied to Brain's comment, thanks.

Note that you might also need to send your comments (by pressing REPLY and then SEND) - by default comments you make on Gerrit are just drafts visible only to you until you send them.

@bwilkerson
Copy link
Member

... has been answered by the comment I made above since December last year.

I am very sorry for the lack of a timely response.

Unfortunately, I sometimes miss emails in my inbox. I wasn't intentionally ignoring you. Please don't hesitate to ping an issue or a CL again if you haven't gotten a response within 2 - 3 business days.

You can also reach us on our Discord channel to let us know that you're waiting for a review.

I changed the version of macros ...

Since then the dependency on the 'macros' package has been removed, so that change won't be necessary once you rebase your changes.

@Frankdroid7
Copy link
Contributor Author

@mit-mit that worked, I have replied to Brain's comment, thanks.

Note that you might also need to send your comments (by pressing REPLY and then SEND) - by default comments you make on Gerrit are just drafts visible only to you until you send them.

Alright, thanks

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/391489 has been updated with the latest commits from this pull request.

1 similar comment
@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/391489 has been updated with the latest commits from this pull request.

@Frankdroid7
Copy link
Contributor Author

... has been answered by the comment I made above since December last year.

I am very sorry for the lack of a timely response.

Unfortunately, I sometimes miss emails in my inbox. I wasn't intentionally ignoring you. Please don't hesitate to ping an issue or a CL again if you haven't gotten a response within 2 - 3 business days.

You can also reach us on our Discord channel to let us know that you're waiting for a review.

I changed the version of macros ...

Since then the dependency on the 'macros' package has been removed, so that change won't be necessary once you rebase your changes.

It's fine @bwilkerson no problem at all.

I have rebased with main.

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.

4 participants