dart-lang / source_gen

Automatic source code generation for Dart
https://pub.dev/packages/source_gen
BSD 3-Clause "New" or "Revised" License
482 stars 104 forks source link

Update constants_test.dart based on new constant evaluator changes. #677

Closed kallentu closed 12 months ago

kallentu commented 12 months ago

Fix the constants test now that the constant evaluator will have new changes and don't resolve with these errors in the test code.

I suspect we weren't catching null checks before and computeConstantValue made a dummy value even when there were errors. The constant evaluator doesn't work that way anymore and will fail to resolve.

Changes found: https://dart-review.googlesource.com/c/sdk/+/312347


Contribution guidelines:
- See our [contributor guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Most changes should add an entry to the changelog and may need to [rev the pubspec package version](https://github.com/dart-lang/sdk/wiki/External-Package-Maintenance#making-a-change). - Changes to packages require [corresponding tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing). Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.