Commit Graph

7128 Commits

Author SHA1 Message Date
Paul Berry c5a79f9a15 Analyzer: stop using NullSafetyUnderstandingFlag in why_not_promoted_test.dart.
The CL to add why_not_promoted_test.dart and the CL to remove
NullSafetyUnderstandingFlag landed around the same time, so we failed
to notice the conflict between them.  The fix is easy: since
NullSafetyUnderstandingFlag doesn't exist anymore (and isn't needed
anymore), we can just remove this use of it.

Fixes bot failures with the test
`pkg/analyzer/test/id_tests/why_not_promoted_test`.

Change-Id: Icec2d57d371229f103b42c5e25d49aab952adc1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182340
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-02-02 20:29:14 +00:00
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 74583b31ed Make looking for BUILD file substitutes in BazelWorkspace optional.
Disable it for DAS, we always have BUILD files when interactive analysis.

Change-Id: I095f74ad25698e7ec07ea94252ee287d29e6a52f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182122
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-02 17:03:14 +00:00
Paul Berry a42244f73b Flow analysis: begin tracking non-promotion reasons.
This CL implements the core flow analysis infrastructure for tracking
reasons why an expression was not promoted.  It supports the following
reasons:

- Expression was a property access
- Expression has been written to since it was promoted

I expect to add support for other non-promotion reasons in the future,
for example:

- `this` cannot be promoted
- Expression has been write captured
- Expression was a reference to a static field or top level variable

These non-promotion reasons are plumbed through to the CFE and
analyzer for the purpose of making errors easier for the user to
understand.  For example, given the following code:

  class C {
    int? i;
    f() {
      if (i == null) return;
      print(i.isEven);
    }
  }

The front end now prints:

  ../../tmp/test.dart:5:13: Error: Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
  Try accessing using ?. instead.
      print(i.isEven);
              ^^^^^^
  Context: 'i' refers to a property so it could not be promoted.

Much work still needs to be done to round out this feature, for example:

- Currently the analyzer only shows the new "why not promoted"
  messages when the "--verbose" flag is specified; this means the
  feature is unlikely to be noticed by users.

- Currently the analyzer doesn't show a "why not promoted" message
  when the non-promotion reason is that the expression is a property
  access.

- We need one or more web pages explaining non-promotion reasons in
  more detail so that the error messages can contain pointers to them.

- The analyzer and front end currently only show non-promotion reasons
  for expressions of the form `x.y` where `x` fails to be promoted to
  non-nullable.  There are many other scenarios that should be
  handled.

Change-Id: I0a12df74d0fc6274dfb3cb555abea81a75884231
Bug: https://github.com/dart-lang/sdk/issues/38773
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181741
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-02-02 16:15:34 +00:00
Sam Rawlins 237c84249b Remove unnecessary imports in analyzer
Change-Id: Ifb9a5c0a31cf3669febf2981b1d26b84f5b9d237
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180781
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-02 14:40:24 +00:00
Konstantin Shcheglov ef9aea6800 Update recordStaticType to receive non-nullable type.
Change-Id: Id7c6d4c3aa3da99b331965f9ad9b002b3dc12e29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-01 21:12:11 +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
Sam Rawlins 2caa4689f1 Analyzer: Allow optional 1st and 2nd params in Future.catchError callback
Change-Id: I448c0e98ae6f86b14b773acb03b04e87c72cc79b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-01 15:49:58 +00:00
Jens Johansen 16a66c8902 [parser] Don't crash, try to recover from written out logical operators and and or
Fixes #44785

Change-Id: I4c7198ea1c223900a58039c032ee303d7da2c14f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181580
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-01 09:30:48 +00:00
Konstantin Shcheglov 4506981ce5 Issue 44815. Fix for '?.' operator in PropertyAccess and binary AST.
Bug: https://github.com/dart-lang/sdk/issues/44815
Change-Id: I9a15a2c13885bb8a9461191a4837a053ae08a34e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182002
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-01 02:06:08 +00:00
Konstantin Shcheglov 65f8699046 Fix for searching required named parameters, merge SearchTest.
Change-Id: Iae337b68507bb2ae26bb7d872ca1bba8df329e08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-28 22:57:55 +00:00
Brian Wilkerson e586c931f7 Improve the highlight range for body_might_complete_normally
Closes https://github.com/dart-lang/sdk/issues/44446

Change-Id: I895253b341f299553441e073efb7485ec086ee5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181640
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-28 19:24:55 +00:00
Sam Rawlins 0a66c39bbe Analyzer: Report incorrect parameters for Future.catchError onError handler.
Fixes https://github.com/dart-lang/sdk/issues/35825

This check ensures that the function type passed to Future.catchError's onError
handler either accepts exactly one positional argument (an Object), or exactly
two positional arguments (an Object and a StackTrace).

Change-Id: Ic0473f6f3032e64fa5df478b478bd97fad8dae5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180680
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-01-28 15:49:15 +00:00
Konstantin Shcheglov 17a78826b7 Index references to any ParameterElement(s), such as required named.
Also switch index tests to the latest language version, with
non-function type aliases feature.

Change-Id: Ia818bde5ec6b83f850336baff4eb48ee0e418d90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181540
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-28 06:34:50 +00:00
Konstantin Shcheglov 3c390c2909 Tweaks for NonConstantTypeArgumentTest.
Change-Id: I19596e8c337799ef3f11650946dd8c7cfec80002
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181462
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-28 06:34:10 +00:00
Konstantin Shcheglov 934980be80 Issue 44780. Fix reporing accessing instance from static when enclosed in local variable.
Bug: https://github.com/dart-lang/sdk/issues/44780
Change-Id: Iec59d928161b68ecf77f95792bd6e9ac8ca0d462
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181305
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-27 00:03:45 +00:00
Daco Harkes bc5952d8e8 [analyzer/ffi] Stop non-const warnings on ..ref
Closes: https://github.com/dart-lang/sdk/issues/44782

TEST=pkg/analyzer/test/src/diagnostics/non_constant_type_argument_test.dart

Change-Id: I434b9e68fb07e37cad03b1418897ea2295f81fc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181204
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-01-26 23:12:00 +00:00
Konstantin Shcheglov 64a8d2a8b8 Fix for indexing constructor references in documentation comments.
Bug: https://github.com/Dart-Code/Dart-Code/issues/2816
Change-Id: I4515b6887f5d8bd93fc6ba59812c5a9ec14f0d3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-26 20:15:44 +00:00
Konstantin Shcheglov 2941757a9a Report NULLABLE_TYPE_IN_EXTENDS_CLAUSE for nullable type aliases.
Change-Id: I51b66f8707c42b2630ea6e92753fe7a839f864fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180941
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-25 22:58:27 +00:00
Sam Rawlins f78b2bcad9 Reland: Report on return types of Future.catchError function
The type of the `onError` parameter of Future<T>.catchError is just Function,
but the function can either have signature `FutureOr<T> Function(dynamic)` or
`FutureOr<T> Function(dynamic, StackTrace)`. This change adds checks for return
statements in a function literal passed to `onError`, and the return type of a
function-typed expression passed to `onError`.

We still need to check parameter types.

https://github.com/dart-lang/sdk/issues/35825

Change-Id: I806d9d30e595fb9d63ae669f3c30c428b60fdf4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180880
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-25 21:30:43 +00:00
Emmanuel Pellereau ba0159688e Revert "Analyzer: Report on return types of Future.catchError function"
This reverts commit d5ee021819.

Reason for revert:
Breaks google3: b/178222419

Original change's description:
> Analyzer: Report on return types of Future.catchError function
>
> The type of the `onError` parameter of Future<T>.catchError is just Function,
> but the function can either have signature `FutureOr<T> Function(dynamic)` or
> `FutureOr<T> Function(dynamic, StackTrace)`. This change adds checks for return
> statements in a function literal passed to `onError`, and the return type of a
> function-typed expression passed to `onError`.
>
> We still need to check parameter types.
>
> https://github.com/dart-lang/sdk/issues/35825
>
> Change-Id: I3a1d1c444e298c5816fcd1d4bc537f7b87fa3da1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176221
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com,srawlins@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I8ebbaac0a4b44293576809baa2dc2c3fdcf35379
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180822
Commit-Queue: David Morgan <davidmorgan@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2021-01-25 12:04:52 +00:00
Konstantin Shcheglov 95cc07e37d Fix ContextBuilderImplTest on Windows.
TBR

R=brianwilkerson@google.com

Change-Id: I88c042ff53fa5ee6fc520cea07eaaf5160eae886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180662
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-01-22 22:14:53 +00:00
Sam Rawlins d5ee021819 Analyzer: Report on return types of Future.catchError function
The type of the `onError` parameter of Future<T>.catchError is just Function,
but the function can either have signature `FutureOr<T> Function(dynamic)` or
`FutureOr<T> Function(dynamic, StackTrace)`. This change adds checks for return
statements in a function literal passed to `onError`, and the return type of a
function-typed expression passed to `onError`.

We still need to check parameter types.

https://github.com/dart-lang/sdk/issues/35825

Change-Id: I3a1d1c444e298c5816fcd1d4bc537f7b87fa3da1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176221
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-22 20:56:09 +00:00
Paul Berry d4fb6b320c Set BinaryExpression.staticInvokeType properly for extension overrides.
Fixes #43114.

Bug: https://github.com/dart-lang/sdk/issues/43114
Change-Id: Ib0adf67c5ac5189732960a5925d7cdbcff0c4102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180441
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-01-22 20:53:24 +00:00
Konstantin Shcheglov aa03d4a8e0 Add AnalysisContext.sdkRoot
Change-Id: I5895b4bb9ba797c93b22f20ee1f2185066de9365
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180622
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-22 20:19:44 +00:00
Konstantin Shcheglov 84f871bc8e Remove several usages of FunctionTypeAliasElement in analyzer.
Change-Id: I93009b2347d6f30d3ad7df20a2fadb4b4c419cf8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-22 17:22:03 +00:00
Daco Harkes c3b30df798 [vm/ffi] Deprecate empty Structs
The analyzer and CFE now report a warning on subclasses of `Struct`
which have no native fields.

Adapted from https://dart-review.googlesource.com/c/sdk/+/180189 to
only deprecate, but not disallow empty structs.

Rolls `package:ffi` forward to migrate `Utf8` and `Utf16` to `Opaque`
to prevent tests from failing on those generating warnings for empty
structs.

Issue: https://github.com/dart-lang/sdk/issues/43974

TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: Ia364e31da66cb195570c2e2b729d03dd261f28a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180361
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-22 13:58:09 +00:00
Konstantin Shcheglov cea28f1ac5 Support for AwaitExpression in binary summary format.
Bug: https://github.com/dart-lang/sdk/issues/44699
Change-Id: I174e015ff8378fafc1c528198df2157532cf393a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180460
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-21 23:15:16 +00:00
Paul Berry 4ee861b7d0 Flow analysis: Track additional assigned variables information.
We now track the following additional information:

- All local variable reads and read captures (previously we only
  tracked writes)

- For any conditional expression (`?:`) or if-test, the variables
  written in the "then" branch

- For any logical and expression (`&&`), the variables written in the
  right hand side of the expression

Tracking this information will allow us to implement legacy type
promotion as part of _fe_analyzer_shared, using the same API as flow
anaylsis, which will in turn allow a lot of front end and analyzer
code to be removed and simplified.

Change-Id: I01aaf64cefb989a4450c8e6d3a8373c1ca2b6dec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179980
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-21 19:48:22 +00:00
Konstantin Shcheglov 2be0ff80d9 Issue 43478. Implement update to least upper bound.
Bug: https://github.com/dart-lang/sdk/issues/43478
Change-Id: Ib0c249a17148a6b6bc04d10e32e158f8cee97bed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180122
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-21 18:37:50 +00:00
Konstantin Shcheglov 8258e38acd Add containsTypeParameter() helper.
Change-Id: Id1a7b22e0a0d5a1b5c3338ec0a216df49933af80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180241
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-21 04:24:03 +00:00
Daco Harkes 1fe4597638 Revert "[vm/ffi] Disallow empty structs"
Revert submission 177862

Reason for revert: breaks g3 without https://github.com/flutter/engine/pull/23808
Reverted Changes:
I50b3b4c31:[vm/ffi] Roll `package:ffi` to `Allocator` and `Op...
I3f5b08c08:[vm/ffi] Change `Pointer<T extends Struct>.ref` to...
I6141c193b:[vm/ffi] Disallow empty structs

Change-Id: Ibe9e8200dbdafe0ee684a6a0ea19e06214edf5e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180184
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-01-20 21:37:11 +00:00
Sam Rawlins cddd44e1e9 analyzer: Add separate code for concrete implementation override check
Erik wrote a great explanation for this check here:
https://github.com/dart-lang/sdk/issues/37993#issuecomment-757976910

Fixes https://github.com/dart-lang/sdk/issues/37993

Change-Id: I6fb0bd530fac495115314838ec0bb2168d5e9ad7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180088
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-01-20 21:27:43 +00:00
Daco Harkes 1a71f94998 [vm/ffi] Disallow empty structs
Closes: https://github.com/dart-lang/sdk/issues/43974

TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I6141c193b6ac71e0dce2735322c62ffd84554cef
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,benchmark-linux-try,dart-sdk-linux-try,pkg-linux-release-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177710
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-01-20 18:08:25 +00:00
Brian Wilkerson bf595ef8bd Remove two diagnostic codes as discussed
Change-Id: I9b76b1b2a4a1ff54cec91add510d11d6708f8fd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180120
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-20 05:17:36 +00:00
Konstantin Shcheglov b4f4de776a Update super-bounded types for null safety.
https://github.com/dart-lang/language/pull/1133/files

Change-Id: I633b328bb62780e09fb58535a83f7f35af161c25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180020
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-19 20:31:03 +00:00
Brian Wilkerson a8ef9f4df1 Add documentation for more diagnostics
Change-Id: I8a2e328fef54e77378558514bf2b62f186fe3451
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-19 18:15:13 +00:00
Konstantin Shcheglov 693b9f730d Fix for resolving file URIs with special characters in BazelPackageUriResolver.
Change-Id: I2e9bb40aa3460b3b60e2354bff1b456851815ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-18 03:41:19 +00:00
Konstantin Shcheglov 5e66c2b1a1 Support for ForPartsWithExpression in binary format.
Change-Id: I69b47c6f21a2923731c91ba4d5edf8394b96408f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-16 19:29:43 +00:00
Daco Harkes 3a0a33f35f [vm/ffi] Add fields to Structs which should not be empty
This CL adds fields to `Struct`s which should not be empty or removes
the structs.

Issue: https://github.com/dart-lang/sdk/issues/44622
Issue: https://github.com/dart-lang/sdk/issues/43974

TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I4a684bd96e3ed16a3fd0dd17019aeabf64ef074a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179182
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-15 12:24:13 +00:00
Konstantin Shcheglov b1b45645d0 Issue 44671. Don't report INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER for identifiers in hide combinators.
Bug: https://github.com/dart-lang/sdk/issues/44671
Change-Id: I810ab30f998c63c8b7a537c6fee7ea39c603be9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179420
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-15 03:45:12 +00:00
Konstantin Shcheglov 7f92bb2988 Remove debug print() in DeprecatedMemberUse_GnWorkspaceTest.
Change-Id: I49ee944f3c0b68417d6b8b448076dedcb8f7e820
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179370
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-15 03:40:52 +00:00
Konstantin Shcheglov e620276d12 Update check for potentially constant types to include any type aliases.
Change-Id: I7d43e532db1d0baa6e64639f174845077631effa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-15 00:46:43 +00:00
Konstantin Shcheglov 6700437384 Update variance computing and default types for non-function type aliases.
Rename some resynthesize tests to make them more consistent.

Change-Id: I6701b9c409973a68b545227b840a05e1bdd237d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179363
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-15 00:43:52 +00:00
Konstantin Shcheglov 56903e6cfb Replace findElementInUnit(), findLocalFunction(), and findLocalVariable() with FindElement.
Change-Id: I508b63fee81dc087489055448debb495a06eff6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179361
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-14 23:15:25 +00:00
Konstantin Shcheglov 7f95c18812 Deprecate CompilationUnitElement.functionTypeAliases
Change-Id: I0f13761adf3d1dfd18798d5b7549e64462be0b65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179360
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-14 22:38:23 +00:00
Konstantin Shcheglov c393930f59 Feature 'constant-update-2018' is always enabled.
Change-Id: I97b9135e2a8e3b01933bf463437220ffd8bf1d0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179160
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-14 19:12:13 +00:00
Konstantin Shcheglov aaabc7537d Use runtime type equality for type literal identity.
https://github.com/dart-lang/language/pull/1389/files#diff-2f9dda5244b707ca3b6d5988c6e5257d6025a99a5fa08ce0dc171c94bdc8ce0dR1256

Change-Id: Ie6b01c1ad5f5ab62ceef3e2672a2174ddaf62db8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-14 01:13:34 +00:00
Konstantin Shcheglov e5d5a0f345 Don't report INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_* when null safety.
https://github.com/dart-lang/language/pull/1389/files#diff-2f9dda5244b707ca3b6d5988c6e5257d6025a99a5fa08ce0dc171c94bdc8ce0dR665

Change-Id: Iccc90f8f9bb877da604d5a5774a931b71a185b91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178928
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-13 21:19:04 +00:00
Konstantin Shcheglov 4bef6607e7 Fill and use DartType.aliasElement/aliasArguments
Change-Id: I71a3b7efbbe8578c47a832cb85aab6177156531f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-12 22:50:44 +00:00