Sam Rawlins
5e040a20f8
analyzer: Improve span of use_of_nullable_value errors
...
This changes the span reported from the _receiver_ to
the _use_ (method name, property name, operator token).
I think this change is overall an improvement.
Specifically, its a great improvement for cmdline
output, where the receiver and the "use" are on
different lines.
One possibly weird change is that if the operator is `[]`,
then I only highlight the `[` character. I don't know if
there is a better place, and I think this is fine.
Fixes https://github.com/dart-lang/sdk/issues/43708
Change-Id: Ie66ddf04b4904a367575193106385dd63ee39985
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188680
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-02 02:43:48 +00:00
Lasse R.H. Nielsen
d352bc28b8
Remove (most) uses of the "non-nullable" experiment flag.
...
Since the flag is now enabled by default, there should be no mention of it.
There are still some uses in front_end/testcases that are not just removable
(it also uses `no-non-nullable`). There migth be more uses that are not
as easily found as grepping for `--enable-experiment
Removes two VM tests where fixing them meant they were just duplicating
the corresponding non *_2/ tests.
Fixes #44941
TEST= Large number of tests chaged.=(no-)?non-nullable`.
Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com >
Reviewed-by: Nate Bosch <nbosch@google.com >
2021-02-12 17:16:54 +00:00
Johnni Winther
4948c31b7a
[test_runner] Support detection of CFE warnings
...
+ some test expectation fixes
Change-Id: Ibf0259914960ea25978f2b8e29aa89336e209f2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162321
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-15 07:57:31 +00:00
Konstantin Shcheglov
ba92b78acd
Move errors from StaticWarningCode to CompileTimeErrorCode.
...
Bug: https://github.com/dart-lang/sdk/issues/42821
Change-Id: I153c48d7a2e4a02026928e6203aacf8f2dc029ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155849
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-26 04:19:25 +00:00
Konstantin Shcheglov
46a2086e6c
Issue 41479. When terminate null shorting at CascadeExpression, don't make it nullable.
...
Bug: https://github.com/dart-lang/sdk/issues/41479
Change-Id: I2d843846ca2a0232dbea60ad2b71e745ac118588
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144672
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2020-04-24 18:45:13 +00:00
Konstantin Shcheglov
eae75026fa
Update tests after rename to UNCHECKED_USE_OF_NULLABLE_VALUE.
...
R=brianwilkerson@google.com
Change-Id: I51544b0955a906920aa80ae30aa9ecbf80294baf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-04-20 02:39:25 +00:00
Konstantin Shcheglov
0f8238efe9
Issue 41036. Add null-shorting for prefix/postfix expressions.
...
Bug: https://github.com/dart-lang/sdk/issues/41036
Change-Id: Iccff235bc81b6e65a3b40f972aaa75707ac2232c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139462
Reviewed-by: Janice Collins <jcollins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-03-16 20:23:16 +00:00
Leaf Petersen
f34fa57d98
Update null aware subscript test
...
Change-Id: Ib3a37f575906c125b850fa82732595f1532c9d9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138721
Reviewed-by: Bob Nystrom <rnystrom@google.com >
2020-03-10 17:41:51 +00:00
Konstantin Shcheglov
bbb449dfa4
Issue 40931. Update inference constraint for T? to be non-nullable.
...
Bug: https://github.com/dart-lang/sdk/issues/40931
Change-Id: I483c3febad236b366f911f38339c712dd928cfcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138790
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2020-03-10 02:19:50 +00:00
Brian Wilkerson
9a62df57fa
Fix a test to get the analyzer nnbd bot to pass
...
Change-Id: I5892c245d4aa984c896471bf18cd71362958d0c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138782
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-03-09 17:47:47 +00:00
Konstantin Shcheglov
550ac009b3
Update tests expectations with DEAD_NULL_AWARE_EXPRESSION.
...
R=brianwilkerson@google.com , paulberry@google.com
Change-Id: I26f585c5ea4ec872d574a8bcd09226b8d1a1cc0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-02-25 21:21:16 +00:00
Konstantin Shcheglov
ed705e8c84
Move DEAD_NULL_COALESCE reporting to ErrorVerifier.
...
So, it is reported even when hints are disabled.
Change-Id: Id2df8faa5421fac00e01755a70aedf3d3f570f10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135492
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-02-13 19:42:48 +00:00
Robert Nystrom
3455133d98
Move NNBD tests (language_2/nnbd) to new NNBD test directory.
...
Change-Id: I0765a1e0fb19f38d7ad1c8655ba444f2f46fbf6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128301
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Bob Nystrom <rnystrom@google.com >
2019-12-12 22:52:31 +00:00