Konstantin Shcheglov
4c6f5f7658
Remove NullSafetyUnderstandingFlag.
...
Bug: https://github.com/dart-lang/sdk/issues/40531
Change-Id: I197cfdf64c697a09bb9e0e3896f3ee5ac1967757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168160
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-02-02 18:03:24 +00:00
Konstantin Shcheglov
9f986d2501
Migrate package:analyzer to null safety.
...
Change-Id: Iffe4370431587e46a141ddc72a86ceec29c163b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176486
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2021-02-01 18:56:04 +00:00
Konstantin Shcheglov
fd4edad020
Update id tests constants/ to use getDisplayString().
...
R=brianwilkerson@google.com , devoncarew@google.com
Change-Id: If7d737ca3a31954e4d3c061d316548e8f54b0d10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-04 23:38:32 +00:00
Konstantin Shcheglov
4490e2f541
Deprecate VariableElement.constantValue, use computeConstantValue().
...
Bug: https://github.com/dart-lang/linter/issues/2073
Change-Id: I68d9c8eaf632c72c4634bb56f13af7ab603e3c5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144666
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-04-24 00:37:52 +00:00
Sam Rawlins
2c420267b7
analyzer: Do not allow errors to be ignored inline. Fixes #27218
...
Change-Id: If37dabba3ec18a9f79f44c4ea38d6920a4013019
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140142
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Nicholas Shahan <nshahan@google.com >
2020-04-10 17:16:24 +00:00
Johnni Winther
5829fc7829
[analyzer,cfe,dart2js] Add marker.options files to automate running id tests on all configurations
...
Change-Id: Ib5eb7f3967634721047f8dcc57b9e6c350b91a41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136226
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-02-21 08:34:26 +00:00
Konstantin Shcheglov
6f6797e745
Add NullSafetyUnderstandingFlag, update APIs to use it.
...
DartType.== implementations ignore nullability if the flag is not true.
TypeSystem APIs eliminate nullability from types before doing anything.
Internally analyzer continues using actual nullability for types.
Package nnbd_migration opted into NullSafetyUnderstandingFlag.
Bug: https://github.com/dart-lang/sdk/issues/40500
Change-Id: Ifeea28c01adf1dc59ed2da675b4a62c6334d529a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134865
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-02-07 21:38:06 +00:00
Johnni Winther
64dae246db
[dart2js] Use CFE constant evaluator for non-required constants
...
Change-Id: Id363332caf29e98307553ec048c2dea36c739d95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129701
Reviewed-by: Sigmund Cherem <sigmund@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2020-01-08 08:21:59 +00:00
Johnni Winther
e3a20bf361
[analyzer,cfe,dart2js] Support annotated code generation
...
Add support for generating annotations from actual data using
option -g
Change-Id: I88d9cdb62a38d579234b15097c9e9bb3d81ebe8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129708
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-01-03 13:57:39 +00:00
Konstantin Shcheglov
364dd8936b
Fix unnecessary_new in analyzer.
...
R=brianwilkerson@google.com
Change-Id: I70f80baa3da4b14c0a52c1f28da16a9ad26d7dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2019-12-06 01:11:30 +00:00
Paul Berry
c4b6df5009
Move ID testing infrastructure into _fe_analyzer_shared.
...
Change-Id: I9f2692dbe750f3c31f8c86e86fe732f34e166517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123860
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-11-01 12:39:00 +00:00
Paul Berry
a0ee662b7b
Move shared analyzer/FE integration test data into shared package.
...
This moves the five test suites for flow analysis along with the
constants test suite.
Note that a few files have formatting errors. I'll fix those in a
follow-up CL.
Change-Id: Ie9bba74c7d91e49ac6c9d3c64a96be007b6a94c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123680
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2019-10-31 15:02:03 +00:00
Konstantin Shcheglov
da75135c7d
Revert "Revert "Issue 37608. Use instantiated FunctionType for tear-off(s).""
...
This reverts commit b31e71e990 .
https://github.com/dart-lang/sdk/issues/38546 was fixed.
https://github.com/dart-lang/source_gen/pull/430 fixed source_gen.
source_gen rolled into google3.
So, I think it is safe to re-apply this change.
Change-Id: Ia40830b733fce2ba4473a847df1af3c30cf139a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119182
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2019-09-28 14:24:45 +00:00
Konstantin Shcheglov
b31e71e990
Revert "Issue 37608. Use instantiated FunctionType for tear-off(s)."
...
This reverts commit acac9ab11b .
Reason for revert: breaks source_gen, see https://github.com/dart-lang/sdk/issues/38546
Original change's description:
> Issue 37608. Use instantiated FunctionType for tear-off(s).
>
> I was working of switching runtimeTypeMatch() to purely
> typeSystem.isSubtypeOf(), without working around dartbug.com/35993
> and dartbug.com/33441, but bots were failing. I think that was because
> of this issue with incorrect tear-off types. We have to fix it before
> switching to less generous TypeSystem.
>
> R=brianwilkerson@google.com , paulberry@google.com
>
> Bug: https://github.com/dart-lang/sdk/issues/37608
> Change-Id: I1f5dfc5e86553a352d72e772e791978772fe8fa4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118379
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
TBR=paulberry@google.com ,scheglov@google.com ,brianwilkerson@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: https://github.com/dart-lang/sdk/issues/37608
Change-Id: Icb6bf93f9b39d3af1d13e9b103afea5364b9169a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118646
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2019-09-25 18:06:16 +00:00
Konstantin Shcheglov
acac9ab11b
Issue 37608. Use instantiated FunctionType for tear-off(s).
...
I was working of switching runtimeTypeMatch() to purely
typeSystem.isSubtypeOf(), without working around dartbug.com/35993
and dartbug.com/33441, but bots were failing. I think that was because
of this issue with incorrect tear-off types. We have to fix it before
switching to less generous TypeSystem.
R=brianwilkerson@google.com , paulberry@google.com
Bug: https://github.com/dart-lang/sdk/issues/37608
Change-Id: I1f5dfc5e86553a352d72e772e791978772fe8fa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118379
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2019-09-23 20:22:07 +00:00
Paul Berry
612825900e
Only create FlowAnalysisResult data structure when running internal tests.
...
The data structure isn't optimized (recording data into it takes
O(n^2) time, where n is the number of unreachable nodes in the file),
and we don't need it for normal execution anyhow.
Following the model used by CFE and dart2js, the analysis driver has a
new flag `retainDataForTesting` to control whether the test data is
gathered, so that under normal execution there is no overhead. The
testing data is stored in a new class `TestingData`; we can expand
this class in the future if we need to record other intermediate
analysis results for testing.
Change-Id: I7e79d31b9f3c9c45121dceb49094be802e4d286f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111481
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-08-05 21:12:43 +00:00
Paul Berry
6c43390cd8
Begin running the shared "ID tests" for constants on the analyzer.
...
This exposed an analyzer bug--see #37608 .
Change-Id: I96af785ce81ebb7b142b4f71cb43942b2b15f879
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110123
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-07-23 22:08:12 +00:00