Commit Graph

8489 Commits

Author SHA1 Message Date
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 d129808d3e Extract FileState._getUnlinkedBytes
So that we can avoid some null checks.

Change-Id: I2f798589e0dbae6802cfde879dfb73978c211728
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-01 23:41:11 +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 0e4dab0b8b Attempt to fix StringSource on windows bot for dart_style
Ideally we should stop using it at all.

R=brianwilkerson@google.com

Change-Id: Ifd891518561806794af809fe6ee4c1dbc4a722d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-01 21:04:31 +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
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
Paul Berry d35cb900ca Expose _flowAnalysis from ResolverVisitor.
This saves a lot of plumbing work in the analyzer, because it allows
the individual resolver components to access flow analysis via the
resolver field rather than needing to maintain their own field.  It
should be helpful in supporting the upcoming "why not promoted"
functionality (#38773), which will require flow analysis to be visible
to even more parts of the resolver.

Bug: https://github.com/dart-lang/sdk/issues/38773
Change-Id: Ibea0ec7e263461d6c512b3dad59f10622b2aac6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181661
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-01-28 23:00:05 +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
Brian Wilkerson 00edf6fd13 Mark newly published docs as being published
Change-Id: I5663eaf6a6df94d279f15ca42364e96054c04987
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180800
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-27 20:19:17 +00:00
Konstantin Shcheglov ab03a9cde5 Issue 43090. Catch parser exceptions in available declarations.
Bug: https://github.com/dart-lang/sdk/issues/43090
Change-Id: Ia4cd891842bfdc7ac0b6a7755a916032bccfa202
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181340
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-27 02:39:15 +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
Daco Harkes e8497a332e [analyzer/ffi] Fix null exceptions
The analyzer has not been migrated, so this is based on manual
inspecation of the API about what can be `null` for now.

Note with the analyzer from master (running in nnbd by default) this
file contains many nullable to non-null assignments. However, we cannot
migrate this file to nnbd yet because of the language version it's used
in.

Closes: https://github.com/dart-lang/sdk/issues/44763

Change-Id: If0432341e7fefb973b0229bcc325eeefed84f7cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180821
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-01-25 15:16:32 +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
pq 3001499c78 data driven sdk api fix support
Change-Id: I5b05044b505fa5936d8148515c61172e443dc129
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180721
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-24 15:41:48 +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
Sam Rawlins f849384456 analyzer: Remove extra space in RETURN_WITHOUT_VALUE
Change-Id: Iba0d7f88b1640ab7c07c71ac529b18633834b0d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180601
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-01-22 18:15:23 +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 d74b2f4672 [vm/ffi] Deprecate Pointer.elementAt and sizeOf generic calls
The analyzer and CFE now report a warning on calls to
`Pointer<T extends NativeType>.elementAt()` and
`sizeOf<T extends NativeType>()` where `T` is a generic.

Adapted from https://dart-review.googlesource.com/c/sdk/+/178200 to
only deprecate but not error out on generic calls.

Does not roll forward `package:ffi` to a version with the `Allocator`
but keeps the generic `sizeOf` invocation. This causes extra warnings
in the pkg/front_end testcases.

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

TEST=tests/ffi/data_test.dart
TEST=tests/ffi/sizeof_test.dart
TEST=tests/ffi/structs_test.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I8f41c4dc04fc44e7e6c540ba87a3f41604130fe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180560
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-22 13:58:09 +00:00
Daco Harkes f74c9d43d3 [vm/ffi] Deprecate Pointer<T extends Struct>.ref generic calls
The analyzer and CFE now report a warning on calls to
`Pointer<T extends Struct>.ref` and `Pointer<T extends Struct>.[]`
where `T` is a generic.

Adapted from https://dart-review.googlesource.com/c/sdk/+/180190 to
only deprecate but not error out on generic calls to `.ref` and `[]`.

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

TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I81353089d59f093730d63792e9dbcd0b2ff0c432
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180365
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-22 13:58:09 +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
Daco Harkes 49ec189fb3 Revert "[vm/ffi] Change Pointer<T extends Struct>.ref to use s..."
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: I1bfe4d70a5f7f35039b8a01d599d33542872574c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180183
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 2e8f9b85a6 [vm/ffi] Change Pointer<T extends Struct>.ref to use static type
This CL changes the semantics of `Pointer<T extends Struct>.ref` to use
the compile-time `T` rather than the runtime `T`.

This enables tree shaking of subtypes of Struct and optimizing `.ref`.

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

TEST=tests/ffi/vmspecific_static_checks_test.dart
TEST=tests/ffi/*struct*test_.dart

Change-Id: I3f5b08c08ec0799ef8aab3c4177e2ac70d25501c
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/+/177862
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-01-20 18:08:25 +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
Paul Berry 75aea30724 Add an implementation of legacy type promotion to _fe_analyzer_shared.
The new implementation uses the same API as flow analysis.  This
should allow us to significantly simplify the CFE and analyzer, by
dropping their implementations of legacy type promotion in favor of
the shared implementation.

This CL just introduces the new implementation and unit tests for it;
it does not integrate it with the analyzer or CFE.  I will follow up
with a CL that does the integration.

Change-Id: Ie07b3b39604d6a022ad42f3ae6b648a317c8af28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179560
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-01-16 17:07:23 +00:00
Konstantin Shcheglov 1f4c720616 Fix TODO in LibraryScope.shouldIgnoreUndefined
Change-Id: I76a5cb69980c11031f58fa8c67d21f3ee2f5ca53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179582
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-15 21:27:22 +00:00
Konstantin Shcheglov 1711659823 Replace findNodeAtOffset() and findNodeAtString() with FindNode.
R=brianwilkerson@google.com, pquitslund@google.com

Change-Id: I7058e347d504e7017e6229e520669d45602decd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179369
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-15 17:15:42 +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 82b81b40a6 Remove unused node_search.dart
Change-Id: I2676c5b632dab925a5857044804d965ab83860a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179366
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-15 01:50:45 +00:00
Konstantin Shcheglov d2f2f734bf Replace findElementsByName() with FindElement.
Change-Id: Ia7b9d6785eb0d727c2bebee2b94fc6258b50d71c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179365
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-15 01:10:24 +00:00