I've also added some runtime checks to
`tests/language/patterns/object_pattern_inference_test.dart` to verify
that the object patterns match when they should match and don't match
when they shouldn't; this helps verify that not only has the front end
inferred the correct type for the object patterns, but it has also
stored the correct type in the kernel representation.
Fixes#51795.
Bug: https://github.com/dart-lang/sdk/issues/51795
Change-Id: I73ce43e440db50d9942deb4a1eb4ee68a5c23142
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290900
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This ensure that the StaticTypeContext used for 'evaluate' is only
used within the method call and doesn't leak to subsequent evaluations.
Included is a repro for the fix in
https://dart-review.googlesource.com/c/sdk/+/290860 which was triggered
by the same underlying problem of the leaky static type context
Change-Id: Ib603c377b420bd75e6a0737e8933343e61fab65c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290961
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Fixes an indentation error in the breaking change issue for which prevented the issue template from rendering.
Change-Id: I317061671f877e562060b3b75b6fa543efc480c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291041
Reviewed-by: Alexander Thomas <athom@google.com>
When unevaluated constants are found in conditions, a lazy region
is created for evaluating the subexpression, ensure that constant
locals are replaced within the subexpressions while still leaving the
subexpressions themselves unevaluated.
In these lazy regions, the result of evaluating the subexpressions
should not be cached, since these subexpressions are not themselves
unevaluated and should be evaluated if encountered elsewhere.
This was previously not done, leading to constants not being
evaluated even when these didn't contain any unevaluated constants.
Closes#51823
Change-Id: Ibfc02fef3ecfcd2f1d2e9e1451f0eb71dde6fb42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290963
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Update the pkg/pkg.dart script to also include information about the size of the pkg/ packages (so we know ~how much code is on older analysis options sets).
Change-Id: Ief1b9a868752a01aef5dd95a4ce1c74795315bc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290615
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
The extracted runtime offsets can handle architecture differences but not OS differences. Compare handling of x18 on ARM64.
TEST=gen_snapshot_fuchsia
Change-Id: Ide7557fa9f0cb5ed3d65f05a68310b88883957fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290704
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Remove the special case for `class C = Object with M;`
and fall into the same code path that would be used for
`class C2 = BaseClass with M;`
This introduces one new class to the hierarchy but that
class contains the members synthesized on the class. This
ensures they do not get lost during the mixin application at
runtime.
It appears likely that this has been broken for some time and
generating incorrect code when methods require covariant checks.
Fixes: https://github.com/dart-lang/sdk/issues/51768
Change-Id: If499b7abd1f8877b9f420ce74b790555c8d258f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290402
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
The expectations set here are updated as fixes/improvements are made in the next 2 CLs.
Change-Id: I0ac251ce09b980cde9e01afc1fa81b987a619747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290980
Reviewed-by: Stephen Adams <sra@google.com>
Change-Id: I5e208edc53543de8d11aa6e81072ad7f61a23d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290913
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
- Update pattern scope tests after CFE switch improvements.
- Fix incorrect end offset detection in expression compiler.
Account for synthetic variables that can have offsets from
later code (i.e. created for hoisting).
Related: https://github.com/dart-lang/sdk/issues/51554
Closes: https://github.com/dart-lang/sdk/issues/51825
Change-Id: I07cd319f8996acae2dada96ba6e43eac9e04fbb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290706
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Unfortunately, IntelliJ cannot easily support `foo:`, only `foo`.
So, I update it to navigate from `foo`, explicit or variable.
Bug: https://github.com/dart-lang/sdk/issues/51797
Change-Id: If4cbf553beedf2998cd6ad3fbd7528865b523420
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290904
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Also adds a new "label" property to @Instance
TEST=pkg/vm_service/test/get_object_rpc_test.dart
Change-Id: I746d56909a55e0158896e1034665147c469109bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290920
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Move from Linux to Mac because the Mac pool has more capacity.
Change-Id: Ie8beb33ea2f3e84f78a2824db5540249d6977e35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290608
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
In pre-feature libraries, don't ignore the class modifier errors except for the base/final subtyping error. Otherwise, we can't even extend `base` types in older pre-feature versions.
Bug: #51683
Change-Id: I32ead106fc8d99a0dd72781368c41afefcfd8f53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289120
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
In pre-feature libraries, don't ignore the class modifier errors except for the base/final subtyping error. Otherwise, we can't even extend `base` types in older pre-feature versions.
Bug:#51683
Change-Id: I884a9b8018899617444b9099bc64aef66bdb1eec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289081
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Breaking change requests are currently received in an unstructured way. To create a more reliable and predictable process, we will use github forms.
This CL creates the form, follow-on CL will update the breaking change documentation.
Issue: https://github.com/dart-lang/sdk/issues/51801
Change-Id: I5ecaa042e3fafdd9d735dd43bccf954aa73e2a2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290605
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This updates the toString on Witness to produce pattern code. The
created pattern is directly derived from the predicates of the
witness and there contain some needless precision, for instance
`[...[...]]` instead of `[...]`. It is the plan to address this in
a follow-up.
Change-Id: Ied7930f36b1e1818540b8c635b18ff92f28e113b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290720
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This fixes a problem where current library of the constant evaluator hasn't be updated to match that of the transformer.
Change-Id: I3386747c20f8283f4a6789dbe33bc48a934d520f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290860
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
We've been using enums to denote procedure types and lowerings, but
with object literals and invocation-level lowering, the code to
handle the enums become increasingly complex. This CL separates out
the logic to individual classes instead.
Change-Id: I896dcfe1a00d649bf19d8e5315ed1deca3c3dad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290606
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
This is due to bd79be0e19, which will break users on older versions of the SDK.
Bug: #51774
Change-Id: I44f3bd5d0e4bc889d393440b03b4bab33d2ca70a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289620
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
I took care to leave code and comments which _does still_ refer to the
remaining Hints. This CL is not super complete, but I think addresses
most of the outdated text refering to Hints. I will do another round
after migrating more to Warnings.
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Iab58dbbfbdef86e21dd65b2a96d8e34e3e7e54ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>