Files
sdk/pkg/analyzer/test
Kallen Tu adb68f4bb0 [analyzer] Provide better errors for invalid .length access in const expressions.
Add a new error message `CONST_EVAL_PROPERTY_ACCESS` for when we try to get 'length' on anything that's not a `String`.

This adds more specific errors for string length that would've went to the catch-all error at the end of `_getConstantValue` before. It should be more clear now what the error is.

Fixes https://github.com/dart-lang/sdk/issues/47273, https://github.com/dart-lang/sdk/issues/52833

Bug: https://github.com/dart-lang/sdk/issues/52833, https://github.com/dart-lang/sdk/issues/47273
Change-Id: I1f5daed82be00c6a8ecd43384d7ff9e59219cbb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319160
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-11 20:08:31 +00:00
..
2022-10-10 17:26:00 +00:00
2023-07-26 17:27:38 +00:00