Commit Graph

8489 Commits

Author SHA1 Message Date
Konstantin Shcheglov 619e388a1d Breaking changes for analyzer version 0.41.
Change-Id: Ib16351e05b498fa9879e6bb4c117638cde276bfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-29 17:08:16 +00:00
Erik Ernst f506071e34 Add DartType.alias{Element,Arguments} and class TypeAliasElement
First step in implementing non-function type aliases in the analyzer:
Just add the new back-references in types, such that they can refer to
a type alias which was used to obtain the type, if any.

Next step: Preserve the aliasElement and aliasArguments in summaries,
next again: Create `TypeAliasElementImpl` and ensure that the parser
can create them.

Change-Id: I1bfbc2c3893e32c5b1826552361a0238aa2b4058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-10-29 14:39:33 +00:00
pq 3c5d1d2575 fix nodes for path error reporting
Change-Id: I515bda93559332d5f2177e6f3167c688c1c85ac8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-10-28 22:54:23 +00:00
Konstantin Shcheglov 774e18d14a Issue 43925. Set the enclosing class for completion.
Bug: https://github.com/dart-lang/sdk/issues/43925
Change-Id: Ide3c8ec104fb9eb92b4d15a14c352e8c7abcb82d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169480
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2020-10-28 21:56:40 +00:00
Konstantin Shcheglov 2fafb4061f Remove LibrariesLog, we don't use it anymore.
Change-Id: I6e72822b973af383726e53ad7ea11c6ebfc10afc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169522
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-28 21:25:30 +00:00
pq e5dfd38404 check for invalid git and path deps in publishable packages
Fixes: https://github.com/dart-lang/sdk/issues/43930

Change-Id: Ia1e7899cf04644387f2686e997e338baa197dac3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169246
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-10-28 20:32:50 +00:00
Konstantin Shcheglov 1958d61b02 Issue 43929. Report HintCode.DEPRECATED_MEMBER_USE for Null Safe from Legacy, refactoring.
Bug: https://github.com/dart-lang/sdk/issues/43929
Change-Id: Ib05f2e44f6cac2acfcb8b3708bd88e38df70d6c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169256
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-28 16:41:20 +00:00
Konstantin Shcheglov 2e99e59369 Fix integration tests for analyzer/ and analysis_server/ in preparation for Null Safety turned on.
Bug: https://github.com/dart-lang/sdk/issues/43777
Change-Id: Ibc5426dd3035c54306bed6e0dec8a6b379163057
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169286
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-28 15:42:55 +00:00
Konstantin Shcheglov 7a60fd3fd2 Fix Glob creation, PubspecValidator dependencyPath.
Change-Id: I898635487e8c51ec732deb64aef81dc68cc82a8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169254
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-28 00:57:53 +00:00
Konstantin Shcheglov d9d7324b27 Issue 43777. Update analysis_server/ tests to run when Null Safety is enabled by default in 2.12
Bug: https://github.com/dart-lang/sdk/issues/43777
Change-Id: Ibd1da16b58b8304d6f1d4260615c7049fc5ffe59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169141
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-10-27 18:19:33 +00:00
pq 3b58a4adcd validate that pub dependencies have pubspecs
See: https://github.com/dart-lang/sdk/issues/43897

Change-Id: I6f22a045c537c3feb3d8f55b16d935ea9f858171
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169042
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-26 19:03:16 +00:00
Brian Wilkerson 6b3f3403ec Unify three diagnostic codes for documentation purposes
Change-Id: I46326160fedb26c92843698dd6513b9fe87e32dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169041
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-26 04:24:55 +00:00
Konstantin Shcheglov 48f3b781ce Extract PackageConfigFileBuilder into lib/src/test_utilities
Change-Id: Iba06c81a709e9c2e37e60f71d087b4dbf0c3e6f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-24 18:35:23 +00:00
pq 1ea407ee6c validate path dependencies
Fixes: https://github.com/dart-lang/sdk/issues/43897

Change-Id: I83cf10ddbb6902db329d58f376f36b7005872a65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168882
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-24 02:39:53 +00:00
pq b16d6bba7f report @doNotStore assignment to top-level vars
Fixes: https://github.com/dart-lang/sdk/issues/43905

Change-Id: I730795543b2f302f9b7eb494791618a4837befe5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168989
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-24 02:34:43 +00:00
Jens Johansen 5a6129406f [parser] Consistently disallow 'late' without 'var', 'final' or type
Fixes https://github.com/dart-lang/sdk/issues/43811
Fixes https://github.com/dart-lang/sdk/issues/43812
Fixes https://github.com/dart-lang/sdk/issues/43813

Change-Id: I39de527883d33459694ec0f91b769676eb52d54b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168641
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-23 06:28:51 +00:00
Konstantin Shcheglov a669f440a6 Revert applying resolution after loading AST for summaries.
Reason: causes Flutter analysis performance regression.
https://github.com/flutter/flutter/issues/68716

We will get back to applying resolution after loading AST when
we switch to the binary format, and so recover enough performance.

WIP for it: https://dart-review.googlesource.com/c/sdk/+/168260
Unfortunately this means that it will get even bigger.


Revert "Separate AST from resolution (per declaration)."

This reverts commit 4d6fba37de.


Revert "Remove commented out code from LinkedUnitContext."

This reverts commit c4f2c8ec3e.


Revert "Issue 43890. Implement applying resolution to IndexExpression."

This reverts commit 088524efa6.


Revert "Issue 43888. Fix for applying resolution to PropertyAccess in cascade."

This reverts commit 1f660a7acf.

Change-Id: I808c1fc62161458d7544d7741e4b358c99b0b55f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-22 22:40:40 +00:00
Konstantin Shcheglov 1f660a7acf Issue 43888. Fix for applying resolution to PropertyAccess in cascade.
Bug: https://github.com/dart-lang/sdk/issues/43888
Change-Id: I3add81b30a3202964445a036f8944d7476b6fc91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168776
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-22 20:38:40 +00:00
Brian Wilkerson 52e968cdef Stop reporting invalid_modifier_on_setter twice
This was being reported by both the error reporter and the parser. This
removes the reporting in the error reporter.

Change-Id: I9934d8a07b530daaeed1ac9edb317c72b7a3655c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168764
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-22 20:27:50 +00:00
Konstantin Shcheglov 088524efa6 Issue 43890. Implement applying resolution to IndexExpression.
Bug: https://github.com/dart-lang/sdk/issues/43890
Change-Id: I537d157ca9ff583b09e7c09ff580202b9dc4ced3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168778
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-22 19:27:10 +00:00
Konstantin Shcheglov 934142766a Remove discarding libraries context on timeout.
Use `linkLibraries` before analysis (after save) instead.

Change-Id: I0b13888398b32cefb6815717c3b0f525492abac0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168767
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-22 16:43:00 +00:00
Brian Wilkerson fd44a07616 Fix handling of excludes from analysis options file in AnalysisContextCollection
Bug: https://github.com/dart-lang/sdk/issues/35519
Change-Id: I76856c0418336ab62ac153f03a6a017088a65847
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168762
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2020-10-21 21:17:04 +00:00
Paul Berry f1843b0abe Add special case migration logic for iterator methods.
This logic allows us to migrate code like this:

    int firstEven(Iterable<int> values)
        => values.firstWhere((i) => i.isEven, orElse: () => null);

Into:

    import 'package:collection/collection.dart' show IterableExtension;

    int? firstEven(Iterable<int> values)
        => values.firstWhereOrNull((i) => i.isEven);

Rather than the default behavior, which would migrate it to:

    int? firsteven(Iterable<int?> values)
        => values.firstWhere((i) => i!.isEven, orElse: () => null);

(The new migration is far superior because it doesn't require the
input iterable to accept null).

This functionality is disabled at the moment, because:
- The changes it makes don't show up properly in the web preview.
- The pubspec is not yet properly updated.

I will address these issues in follow-up CLs and then enable the
feature.

Change-Id: I96f3b12d682c586631920b38406bad6aa3f4789e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168500
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-20 17:45:04 +00:00
Lasse Reichstein Holst Nielsen 92e52a1874 Remove direct dependencies on package:charcode from SDK.
Change-Id: I9ef36e8a6890a70baac6c18f0be2252dcf5453df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163941
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-20 13:07:53 +00:00
Konstantin Shcheglov 92704cf8e4 Don't set types for class/constructor/getter identifiers of annotations.
They are not expressions, and so don't have types.

Actually setting a type for a constructor of a generic class breaks
summary serialization because `T Function()` type of the constructor
`class A<T> { const A.named()l }` is not valid - `T` is not in scope.
So, this crashed the linker.

Change-Id: I25a6e5eb6902faa479e4dcb683ef3936af07b5b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168420
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-19 23:25:48 +00:00
Konstantin Shcheglov c003c1a64d Don't read referenced files in AnalysisDriver until necessary.
Bug: https://github.com/dart-lang/sdk/issues/43744
Change-Id: I06d58b2a11fdf2db9bd6800f350ac25b8aab3fb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-19 19:00:07 +00:00
Konstantin Shcheglov 23b9cce2a1 Issue 43777. Update analyzer/ tests to run when Null Safety is enabled by default in 2.12
Bug: https://github.com/dart-lang/sdk/issues/43777
Change-Id: If7e5f71fe1d8277898a02745f96f1c8003cc8069
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168240
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-19 16:40:17 +00:00
Sam Rawlins ccba500cda Analyzer: Support visibleForTesting/Template on top-level variables
Fixes https://github.com/dart-lang/sdk/issues/43508

Change-Id: I5a0792c48c284ceedfc6edea70a5979647b6e39e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-10-19 15:36:57 +00:00
Paul Berry 0ad6807c62 Fix BazelWorkspace.findPackageFor's handling of binPaths.
Previously, we were assuming that each path in `binPaths` was just one
level deeper than the corresponding source code path, and therefore we
could map a path in `binPaths` to the corresponding source code path
by just removing the first directory (e.g. map `bazel-out/foo/bar` to
`foo/bar`).  But this isn't correct: the paths in `binPaths` are more
deeply nested, e.g. `bazel-out/k8-fastbuild/bin`.  This CL changes the
algorithm to use `context.relative`, so that we get the correct path
mapping regardless of the nesting depth.

Change-Id: I870a7fca18e689691efcc32da527135643255eca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168127
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-18 23:35:16 +00:00
Brian Wilkerson 35ce26e0db Validate ignore comments
This adds checks for three cases:
- error codes for diagnostics that are not being produced,
- error codes that can't be ignored (with a severity of error), and
- error codes that are already being ignored.

I originally also checked for names that are not defined as error codes
(which turned up at least one valid issue in the Flutter repo), but we
don't have a list of all valid names against which to compare because
plugins can add new diagnostics.

It should be noted that, as written, these diagnostics can't be ignored,
despite being hints. The reason is as follows: in order to detect
diagnostics that are not being produced, these checks need to have a
list of the diagnostics that _are_ produced. If an ignore comment
attempted to ignore one of these hints, this validation would occur
before the hint had been generated, so that comment would in turn appear
to be unnecessary.

If we need them to be ignorable, then we can special case them so that
they are never reported as being unnecessary.

And after running this over the Flutter repo I commented out two of the
three codes because there are violations. Many of the violations are
valid and need to be cleaned up. Some are the result of "ignore" being
used for other purposes. The Flutter team has said that we can replace
their use of "ignore" in order to enable these hints, but I don't have
time to do that right now and I'd like to get this landed before it bit
rots again.

Change-Id: I1704105621bef5a5c49202267c99aa1d950a26a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156402
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-18 16:53:06 +00:00
Konstantin Shcheglov b155af2442 Update documentation for ElementAnnotation.element
R=brianwilkerson@google.com

Change-Id: I166545cd2359370d2bfff5fdfaa36c5ce6950f52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168129
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-17 17:37:15 +00:00
Konstantin Shcheglov c4f2c8ec3e Remove commented out code from LinkedUnitContext.
Change-Id: Ie98122bfa5d9dfcf60f6ea3734a4c44c905ffee5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168128
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-17 16:52:35 +00:00
Konstantin Shcheglov 494eb72413 Implement AnalysisDriver.getErrors() using performWork().
One possible issue with not doing this is that we would not apply
changes reported as changeFile(path).

Change-Id: Ic88ec05f997c9f90c6bd877d4612f01a6086364d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168221
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-17 16:50:55 +00:00
Brian Wilkerson 9c70b5f5b8 Report invalid_annotation_target when the annotation is a getter
Bug: https://github.com/dart-lang/sdk/issues/43830
Change-Id: Ie7f57b56b75d7ad274fd1473e028ed62d0f08a2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168126
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-16 20:38:22 +00:00
Konstantin Shcheglov 4d6fba37de Separate AST from resolution (per declaration).
Change-Id: Ic05781f98636e992c5c51d94cde51aa8c64663a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167242
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-16 16:33:42 +00:00
Konstantin Shcheglov 94985b1178 Fix for crash when overriding a setter without parameters.
https://crash.corp.google.com/browse?q=product_name%3D%27Dart_analysis_server%27+AND+product.Version%3D%272.10.324558781-edge%2Bgoogle3-v2%27&stbtiq=&reportid=1f4a951a32533b7d&index=13#0

R=brianwilkerson@google.com

Change-Id: I7f96c67311e8f5e8698bead0d4d00b3968801c72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167903
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-16 16:16:03 +00:00
Keerti Parthasarathy fdad84fa5b Modify FileResolver / bytestore to keep track of invalidated cache elements.
Change-Id: I60cb1f5f04eb9a1ee34c50157d5ed2da92d408ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167861
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-16 00:17:31 +00:00
Konstantin Shcheglov 6cc220ec63 Add FileResolver.linkLibraries(), fix null typeProvider.
Change-Id: I4222097336407736e4cf0c3e922e9fac8c762725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-15 20:57:07 +00:00
Konstantin Shcheglov aad1a677c0 Deprecate GenericTypeAliasElement
See also https://dart-review.googlesource.com/c/sdk/+/166680

Change-Id: I6018f3bf5796dcc8ab059aab5b29d01e7336581b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167727
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-15 16:03:26 +00:00
Brian Wilkerson 51b8dfb6fd Remove the unreported access_private_enum_field diagnistic
If this diagnostic needs to be generated, then I can create an issue to
track that work, but I think we handle it by not defining the private
fields in our models, which means the issue is reported as an undefined
getter.

Change-Id: I8d220adf0d11b2c65f8953eec57a87f86f520d74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-14 19:36:43 +00:00
Konstantin Shcheglov 779a3219f3 Ignore names _$foo when there is a missing .g.dart part.
Change-Id: I5a103cd362318b4db292b5f41da9e56a60f6431d
Bug: https://github.com/dart-lang/sdk/issues/42832
Bug: https://github.com/dart-lang/sdk/issues/42977
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166820
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-14 19:28:38 +00:00
Konstantin Shcheglov fbfc723de7 Use CompoundAssignmentExpression instead of LHS element/type.
This adds some technical debt in form of using writeOrReadElement in
clients, which can be paid incrementally by migrating these places to
handling assignment like expressions one by one. Doing it all in one
CL was too much. But now the underlaying AST resolution will be
sound.

In the next breaking change we will remove
setAssignmentBackwardCompatibility(), so stop setting elements/types
for assignment targets.

Change-Id: I11626876cfed25653edb0cc18544aba51cef5965
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-14 18:45:08 +00:00
Paul Berry 9249d7a678 Add assertion to make sure analyzer sets NullSafetyUnderstandingFlag.
Change-Id: Ic0e3681117cb9783be6ee5b92ba8f79978d6c9bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167361
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-14 15:25:17 +00:00
Paul Berry d0fafb6329 Enable the null safety understanding flag in _computeResolvedLibrary.
This is the _compute function used by the migration tool.  It needs to
set the null safety understanding flag in order to ensure that type
comparisons work properly when analyzing code that's already been
migrated.

Fixes #42308.

Bug: https://github.com/dart-lang/sdk/issues/42308
Change-Id: I347b99a3a2cc772bb158b2ba8621ac7bb632653a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-13 16:15:47 +00:00
Paul Berry a1e1a23353 Allow MockSdk's allow list to be configured.
This will be needed for NNBD migration unit tests, to verify that a
partially migrated package is interpreted properly.

Bug: https://github.com/dart-lang/sdk/issues/42308
Change-Id: Id36d08de00f7ee38c1b415b457ff0da0447a4546
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-12 23:58:32 +00:00
Brian Wilkerson e98f5db3c4 Use the correct quote in markdown
Change-Id: If2fe99b7d1d9880674be294b08b352982b9c6c45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167020
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-11 15:56:42 +00:00
Brian Wilkerson c2314f1a57 Unify two diagnostics for documentation purposes
Change-Id: Icd100bafd1222144688f68c1bc3d2a4a7c29d10d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167001
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-11 15:56:40 +00:00
Brian Wilkerson 4322f2a518 Mark diagnostics for which documentation has been published as having published docs
Change-Id: I749bd5e35dbb2cb54f21fa8cb5f1ccc1ebf14c64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-11 15:38:20 +00:00
Konstantin Shcheglov 5b52dfccf5 Fix --default-language-version support.
Re: https://dart-review.googlesource.com/c/sdk/+/166790
Change-Id: Ic646f4cf8c59810e856722a9099cadd364bad96a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166923
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-10 23:55:20 +00:00
Konstantin Shcheglov 863e958cad Fix the issue with reusing LinkedElementFactory and supertype for Object.
Bug: https://buganizer.corp.google.com/issues/170429675
Change-Id: Ieaec29e8b09ce5cc9c02e7dce5919e8b56278910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166789
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-09 17:34:57 +00:00