Commit graph

90744 commits

Author SHA1 Message Date
Nicholas Shahan b49582196c [ddc] Use sound null safety when training snapshot
Change-Id: I89761a8248fbca64ed066dafbc3c5ece8be1c455
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291302
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-03-27 21:28:51 +00:00
Alexander Aprelev 67683c3973 [vm/isolates] Introduce 'vm:isolate-unsendable' pragma.
Decorate Zone, Future, Completer, Timer and Stream with newly-introduced pragma to make sure that message verification stops earlier, produces shorter retaining path for the user.

BUG=https://github.com/dart-lang/sdk/issues/51722
TEST=send_unsupported_objects_test,isolate_exit_unsendable_test.dart
CoreLibraryReviewExempt: vm-specific pragmas
Change-Id: I499eea542d228ac9cf0797a682664f93f360dc80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289027
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-03-27 20:54:11 +00:00
Sam Rawlins 5b510210db [analyzer] Report use of deprecated fields in ObjectPatterns
Fixes https://github.com/dart-lang/sdk/issues/51678

Change-Id: Ia9292223163f3955d97fe9cea47873207be85b5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289028
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-03-27 20:22:12 +00:00
Brian Wilkerson d0ab7947e3 Update to the latest version of the unified analytics package
Change-Id: I6061cd892181e0b724965042d11cfba3ad2461de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291303
Reviewed-by: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-27 19:14:10 +00:00
Johnni Winther 8d78983ef6 [_fe_analyzer_shared] Support intersection types in exhaustiveness
This adds handling of type variables with bounds and intersection types
in exhaustiveness checking. These are handled using [WrappedStaticType]s
where the type variable is the implied type and the bound is the
wrapped type from which the subtypes are computed, thereby supporting
sealed types in the bounds.

The change also includes some cleanups a fixes found during
implementation, amongst these a fix to no longer cache the map/list
type identities objects. These were not used as identities, similar to
the value identities used for enum and bool values, but instead as
restrictions on the the static type. These have therefore been renamed
to Map/ListTypeRestriction to reflect that.

Closes https://github.com/dart-lang/language/issues/2878
Closes #51819

Change-Id: I56e94e4f0dc6695288ab978687d8c95835535b8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291220
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-27 19:02:24 +00:00
Kallen Tu 0936bceaa0 [cfe] Remove tests that use interface mixins, final mixins and sealed mixins.
Remove/change some frontend tests to make for easier removal of these invalid
mixins in https://dart-review.googlesource.com/c/sdk/+/290614.

Change-Id: I50325b8275704eb2542c5871bb6326356bd9b020
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291053
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-27 18:56:46 +00:00
Ryan Macnak ec8688d97a Reland "[build] Don't combine stdout and stderr when consuming git output."
Ignore non-zero exit code during GetGitRevision.

Bug: https://github.com/flutter/flutter/issues/123416
Bug: https://github.com/dart-lang/sdk/issues/51865
Change-Id: Ifff7251d478cfd742a60ba6dcdeb60e581279b75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291300
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-27 18:02:38 +00:00
DEPS Autoroller 98f18ec45a Roll gn from fe330c0ae1ec to 41fef642de70
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/gn-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com,dart-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in gn: https://bugs.chromium.org/p/gn/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: I61e474868b8b90bae04f4beb39ecfaa4462ae4e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291059
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-03-27 17:59:38 +00:00
Danny Tuppeny b905e9c3cb [analysis_server] Don't support moving sealed types with direct subclasses in other parts
Change-Id: I8ad118171e1afe0f4bcfbe8888927e41ce35b34b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291222
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-27 16:41:08 +00:00
Danny Tuppeny 2361a164c8 [analysis_server] Fix moving classes to existing files that have directives
Previously when moving to an existing file, the moved declarations would be put at offset 0, regardless of whether there are existing directives.

This change causes new items to always be added at the end of the file instead (+ adds some tests for handling moving between parts).

Change-Id: Ie3e218a8c5ebf24cc680d576a0f852661fc42c29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291240
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-27 16:39:53 +00:00
Danny Tuppeny 7ce6c20fb8 [analysis_server] Show LSP quick-fixes for multiline diagnostics on lines other than the first
Fixes https://github.com/Dart-Code/Dart-Code/issues/4462.

Change-Id: Ie932a5cce64d98bf5177c28207f94b9f34b0b7ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291281
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-27 16:30:54 +00:00
Sam Rawlins 85f17f1de1 Bump linter to widen reportError parameter type
There should be no additional lint reported with this bump.

Bug: https://github.com/dart-lang/sdk/issues/51678
Change-Id: Ia8791e658a86cbc8241468d80c783affc34ed80a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291046
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-03-27 16:24:48 +00:00
Sam Rawlins 9efaeb5da3 Add CHANGELOG 3.0.0 entries for Analyzer
Change-Id: I3333cf7346ee4a7d104762ccf55677413d39a6ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291140
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-27 15:07:47 +00:00
Sigurd Meldgaard d5da8dc67d Improve dartdev testing
* Auto-dispose the TestProject (several instances were never disposed)
* Don't rely on package:test by default from the test-project.

Change-Id: I383eb36cbacb341b702f42075af562d20a2be45d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291069
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2023-03-27 14:52:23 +00:00
dependabot[bot] 782b5d65cc Bump actions/checkout from 3.3.0 to 3.5.0
Closes https://github.com/dart-lang/sdk/pull/51859

GitOrigin-RevId: 1dc27f39b5eaabbd928e722385d686b5bb5e3524
Change-Id: Id72e60c1b2adecdd3281975e27b65234d724726e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291203
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2023-03-27 14:50:04 +00:00
dependabot[bot] 4bb44c5454 Bump github/codeql-action from 2.2.5 to 2.2.8
Closes https://github.com/dart-lang/sdk/pull/51858

GitOrigin-RevId: 73b8f151de44d2508a8eb890f39e8044dc518e42
Change-Id: Ic18c18ab6f9d229224c312bb8743208c2615e42d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291202
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2023-03-27 14:44:20 +00:00
Zach Anderson fa0c81efe1 Revert "Reland "[ Observatory ] Disable serving Observatory by default""
This reverts commit fb1516c4ea.

Reason for revert: https://github.com/flutter/flutter/issues/123516

Original change's description:
> Reland "[ Observatory ] Disable serving Observatory by default"
>
> This reverts commit 5a8ddc0756.
>
> Reason for reland: fix for failing Flutter test landed upstream
> in https://github.com/flutter/flutter/pull/122419
>
> TEST=pkg/dartdev/test/commands/run_test.dart
>
> Change-Id: I1152296828428e118ccba11025f25f6b1dbbb0f3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290921
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

Change-Id: I4e35f93ef4ac46c6dbd905903496a27107eb8329
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291180
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-27 14:42:01 +00:00
Johnni Winther 48df4211f8 [cfe] Include more implicit cast in lowering
This adds the implicit casts to the result of relational pattern
matching and guards in if-case elements/map entries.

Closes #51724

Change-Id: I368528534341194555f091174151d8510b136358
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291221
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-27 13:35:08 +00:00
Daco Harkes e687628f93 [analyzer/ffi] Remove custom FFI checks covered by class modifiers
TEST=pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart
Shows how duplicate errors are removed.

TEST=pkg/analysis_server/test/src/services/correction/fix/remove_name_from_declaration_clause_test.dart
Note that two of the dartfix tests automatically suggest the same fix
for the class-modifier based errors instead. However, the two other
tests do not suggest a REMOVE_NAME_FROM_DECLARATION_CLAUSE fix.

Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: Ic0a577d6d13ca8aa899d404f97db38029a5e8de4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291062
Reviewed-by: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-03-27 12:42:59 +00:00
Daco Harkes 7a90dd0c4f [cfe/ffi] Remove custom FFI checks covered by class modifiers
Tests are in the following files 3.0 and pre-3.0 respectively.
TEST=tests/ffi/vmspecific_static_checks_test.dart
TEST=tests/ffi_2/vmspecific_static_checks_test.dart

Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: Ib0b27590748ef788c5475929fde585c790f64e63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291064
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-03-27 12:15:22 +00:00
Chloe Stefantsova f27548aa5a [cfe] Coerce expressions in pattern assignment and declaration RHS
Closes https://github.com/dart-lang/sdk/issues/51738

Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I4d496c303b1762c7234d66436daf125e69a34316
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291068
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-03-27 10:01:53 +00:00
Sigurd Meldgaard cc9526fea8 Use platform based path separator in test
Change-Id: I750b236a39bc9338c84a2a6bf1fcfcde1de1aac4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291070
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2023-03-27 09:39:19 +00:00
Brian Wilkerson 5d98b0eb9f Enable producing links for new diagnostics
Change-Id: Ia902868bc19a32286df0b0a52aae86c6aa426169
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291052
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-26 15:04:22 +00:00
Alexander Markov 5117c45770 [vm/compiler] Combine argument type with static and inferred parameter types during inlining
Previously, when preparing a Parameter stub during inlining, compiler
unconditionally used argument type (from the caller). This type
could be less accurate than static or inferred parameter type of
the callee. For example, the argument could originate from inlined generic ListIterator.current:

  v24 <- LoadField(v23 . _current@9040228) T{X0??}

and static type could be 'int'.

This change combines argument type from callee with a parameter type
from caller during inlining. In order to get parameter type for
optional parameters, ParameterInstr is extended to hold real parameter
index and ParameterIndex::ComputeType is extended to work on
parameters which are not passed directly.

Also, this change fixes the incorrect non-nullable receiver type for
Object and Null methods.

TEST=runtime/tests/vm/dart/regress_51790_il_test.dart
Fixes https://github.com/dart-lang/sdk/issues/51790

Change-Id: I19fff19833a6148ed36a16895626e4e1d8ae62d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290602
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-03-26 03:42:30 +00:00
Alexander Aprelev 7aaad727fa Revert "[build] Don't combine stdout and stderr when consuming git output."
This reverts commit 1ac8b374a2.

Reason for revert: Broken debianpackage bot https://ci.chromium.org/p/dart-internal/builders/ci/debianpackage-linux-main/4682

Original change's description:
> [build] Don't combine stdout and stderr when consuming git output.
>
> When the alternate objects path is broken, `git log -n1 --pretty=format:%cd` will output `error: unable to normalize alternate object path: .git/objects/no/such/path` to stderr, and we don't want this mixed into the version string.
>
> Bug: https://github.com/flutter/flutter/issues/123416
> Change-Id: Ief03e57febd5a42f5cbba2b14a736d949a90ae82
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291050
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

Bug: https://github.com/flutter/flutter/issues/123416
Change-Id: If100a66a7b94a2c540aa9e4f28902ce6f6ab8d64
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291056
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-03-25 04:37:43 +00:00
Sam Rawlins 755432f73e Reinstate HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE
This reverts parts of https://dart-review.googlesource.com/c/sdk/+/289444

The code needs to be reinstated as flutter has tests which
verify that certain data-driven fixes work, which happen to
be uses of deprecated members, from the same package. See
this failure for example:
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8785707696655090305/+/u/analyze_flutter_flutter/stdout?format=raw

The linter bump is kept the same, and some code which was
unnecessarily coupled tightly with
DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE is kept the same.

The big test refactor which was included in 289444 is also
kept the same, only a few tests are added to verify
HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE gets reported.

Bug: https://github.com/dart-lang/sdk/issues/51678
Change-Id: I6852376b299d8375c720ea56dc6a6a6119de3364
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291054
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-25 01:39:37 +00:00
Alexander Aprelev 9daa67967f [vm/reload] Ensure we only morph instantiated classes and enums.
Fixes https://github.com/dart-lang/sdk/issues/51835
TEST=IsolateReload_EnumInMainLibraryModified

Change-Id: I4a8993cb44619a552866430b92f3941d49afbae6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291051
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-03-25 01:33:07 +00:00
Kallen Tu fd1b48d82e [tests] Remove interface mixin, final mixin, and sealed mixin from language tests.
Change-Id: I8d92758c3a43ed0eff2e0c953ae8a87e65a3a920
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291047
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2023-03-24 23:04:47 +00:00
Ryan Macnak 1ac8b374a2 [build] Don't combine stdout and stderr when consuming git output.
When the alternate objects path is broken, `git log -n1 --pretty=format:%cd` will output `error: unable to normalize alternate object path: .git/objects/no/such/path` to stderr, and we don't want this mixed into the version string.

Bug: https://github.com/flutter/flutter/issues/123416
Change-Id: Ief03e57febd5a42f5cbba2b14a736d949a90ae82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291050
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-24 22:00:11 +00:00
Leaf Petersen 386825ee8c Add tests for the transitivity of the base modifier when applied to
base mixins and base mixin classes.

Change-Id: Idfe7576f38382c5e9a0ff968aae00f48990e1d38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290351
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2023-03-24 21:59:23 +00:00
Konstantin Shcheglov 84c0f2c880 Sanitize arguments of super/redirecting constructor invocations.
We have a spike of crashes internally.

Change-Id: If7c280692ac0acdd2e4a4acd6096a4669746069c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291120
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-24 21:42:37 +00:00
Konstantin Shcheglov edccf64f54 Fix for highlighting mixin names.
Change-Id: Idadb02aa1b86525fde307a5eddc8876f152d1b31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291045
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-24 21:37:57 +00:00
Sam Rawlins 6f3f4b598f Treat warnings more like hints (less like errors) in driver, fixes, and completions.
The presence of errors (and previously, warnings) affects what
completions are offered (or their order?) and what fixes are offered
(or their order?), and the order of re-analysis.

When unused local variables and imports etc are WARNINGS, fixes,
completions, and re-analysis should not regress.

Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: If5141eec7df01f50caee5bf245c031b5a51ea590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-03-24 21:03:48 +00:00
Konstantin Shcheglov 6123ac7490 Require the language level >= 2.12 only if the Dart SDK that runs the analyzer is at least 3.0.0
...including any pre-release versions of 3.0.0 too.

Change-Id: Id95c3f126e86be5fe0430ca4adfe22adcafadc0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291049
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-24 20:49:22 +00:00
Paul Berry df7c4bb439 Allow empty switch expressions.
This an experimental change; we haven't yet decided whether we want to
allow this.  See https://github.com/dart-lang/language/issues/2939 for
discussion.

Bug: https://github.com/dart-lang/language/issues/2939
Change-Id: If69ab66d18ae7ec3dfc79496ce13517ef1c15227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290907
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-24 20:22:52 +00:00
Janice Collins ac4790ad7c Update dartdoc to 6.2.1.
Release notes: https://github.com/dart-lang/dartdoc/releases/tag/v6.2.1

Change-Id: I8e6df59e562818d4f5f98f04c0a58342c43f13e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291048
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
2023-03-24 20:19:20 +00:00
Paul Berry 2c16ff8827 Fix error reporting and recovery for declared variable in pattern assignment.
If a declared variable occurs inside a pattern assignment (e.g. `[a,
var b] = c`), we now recover using the `DeclaredVariablePattern` AST
node.  Normally, a `DeclaredVariablePattern` wouldn't appear inside a
pattern assignment, but it's better to recover in this way because it
avoids dropping the keyword token (`var` or `final`) or type.

Fixes #50927.
Fixes #51529.

Bug: https://github.com/dart-lang/sdk/issues/50927, https://github.com/dart-lang/sdk/issues/51529
Change-Id: Ia65853baeae0e8eb999b7bd82fb2455e10b2b996
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291044
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-03-24 20:14:49 +00:00
Brian Wilkerson f4bbc427c3 Implement the legacy protocol for showing messages and URIs to users
There is a desire to unify the two subclasses of the analysis server,
but I didn't attempt to do that in this CL.

Change-Id: I17bbf4f6247fc547df1c82f02e74c50eabe7aadc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2023-03-24 18:10:17 +00:00
Kallen Tu 24d210a18c [tests] Fix existing on clause tests for final classes.
Disallow using final classes on on-clauses outside of its library.
Update tests to show this behaviour. (Or at least in a state where I can test out the implementation)

Change-Id: I74306c873dbd047c6b94d8e8e75c215562dd9483
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290915
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2023-03-24 18:07:52 +00:00
Ivan Inozemtsev 22f6200fb0 Convert TLS exceptions to HTTP exceptions
Bug: b/270438568
Change-Id: I57af86e42d3dd258186250ff0d6ea45cc51a176d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291067
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-24 17:41:18 +00:00
Brian Wilkerson 4e29f0b339 Add documentation for two more diagnostics
Also adds a dropped link target so that we don't break existing users.

Change-Id: I98e5e9fe2e51730150acfab889245a7b9f6b11d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290180
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-24 17:36:28 +00:00
Sigurd Meldgaard 9e5ba648af Bump pub to 8434b40d6a21dece68c4880e59dbdedfbd6bd7e5
Changes:
```
> git log --format="%C(auto) %h %s" 4bd757c..8434b40
 https://dart.googlesource.com/pub.git/+/8434b40d Be more quiet when doing implicit pub get (3847)
 https://dart.googlesource.com/pub.git/+/29a7c099 Dependency services: preserve pub.dartlang.org in lockfile (3846)
 https://dart.googlesource.com/pub.git/+/41963ddd Api entrypoint for ensuring resolution is up-to-date (3844)
 https://dart.googlesource.com/pub.git/+/92f6bf79 If pinned to an exact version, keep the pin when bumping (3736)
 https://dart.googlesource.com/pub.git/+/c68939ba Add missing closing quote in dependency override example (3843)
 https://dart.googlesource.com/pub.git/+/0cdeb85f Hint if version is not an incremental update (3840)
 https://dart.googlesource.com/pub.git/+/c795dcd8 Upgrade language version to 3.0 (3822)

```

Diff: https://dart.googlesource.com/pub.git/+/4bd757ce1dad04035fb0dbc6156879af23d8b3b8..8434b40d6a21dece68c4880e59dbdedfbd6bd7e5/
Change-Id: Ia0b7e8742522904454c318a381f983398be82838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291066
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2023-03-24 17:17:15 +00:00
Kallen Tu 2407f7338d [analysis_server] Remove interface, final, and sealed mixins from the analysis server.
Change-Id: Id774379c92904f27326f502299c67adb825a00b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290914
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-24 17:09:24 +00:00
Kallen Tu 2e19faaec9 [cfe] Report an error when implementing a base class through a sealed class.
Bug: https://github.com/dart-lang/sdk/issues/51811
Change-Id: Ifad0519332965d79719173702293b48e94231024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291040
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-24 17:09:09 +00:00
Sam Rawlins fd4602f019 Bump linter to include deprecated_member_use_from_same_package
We also stop reporting
`HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE` and
`HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE`
as these are now replaced by the new lint rule.

The biggest change here is in the DEPRECATED_MEMBER_USE tests,
as most of these tests have
`DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE` reported (since it's
easier to write tests with files in one package). We move all
of those tests to `DEPRECATED_MEMBER_USE` tests, without losing
coverage.

Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: I7cada44265cd0e1e47ab77d4354de9a5571db614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289444
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-03-24 16:35:37 +00:00
Paul Berry 8f6325d650 Patterns parsing: handle incomplete identifier . in a pattern.
Bug: https://github.com/Dart-Code/Dart-Code/issues/4407
Change-Id: Ibac9822fa6cf2f15aa67b68a28f399cf4373e782
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291043
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-03-24 16:10:09 +00:00
Ben Konyi c927840920 [ VM ] Add support for samping heap profiler in PRODUCT mode
Requires INCLUDE_SAMPLING_HEAP_PROFILER to be defined.

TEST=DartAPI_HeapSampling_*

Change-Id: I1c95be4747b295823a8fae1f369f9dc5d95a274e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290620
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-03-24 14:02:14 +00:00
Ben Konyi 689042093d [ VM ] Re-work heap sampling profiler APIs to make use of WeakTable
TEST=updated dart_api_impl_test tests

Change-Id: Ibb6789286a88c96151a466617054d703cceed61e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290160
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-24 14:00:09 +00:00
Ben Konyi fb1516c4ea Reland "[ Observatory ] Disable serving Observatory by default"
This reverts commit 5a8ddc0756.

Reason for reland: fix for failing Flutter test landed upstream
in https://github.com/flutter/flutter/pull/122419

TEST=pkg/dartdev/test/commands/run_test.dart

Change-Id: I1152296828428e118ccba11025f25f6b1dbbb0f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290921
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-24 13:25:30 +00:00
Paul Berry f9c45af689 Fix nomenclature around upwards/downwards/partial inference to match spec.
The spec uses the terms "upwards" vs "downwards" inference to refer to
whether type constraints come from a return type or parameter types.
Previous to this change the code used the terms "upwards" vs "partial"
inference to refer to whether the types being chosen were preliminary
(and hence might contain `?`s) or were the final inferred types.  This
led to confusion; for example the method
`downwardInferObjectPatternRequiredType` was calling `upwardsInfer`.

This change adjusts the nomenclature so that the methods that choose
types are called `choosePreliminaryTypes` and `chooseFinalTypes`, to
avoid any confusion with the direction of inference.

See discussion here:
https://dart-review.googlesource.com/c/sdk/+/290613/comment/894a767c_e269584e/.

Change-Id: Ie05dcae027ca82b2ce7e5a57f1846412d5b32d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290901
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-03-24 12:25:18 +00:00