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>
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/2878Closes#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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>