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>
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>
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>
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>
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>
- 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>
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>
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>
I'm reverting the work queue change for the main inferrer branch. After some instrumenting I've found that it's rather sensitive to the max refinement limit which is very low for the non-experimental branch. In the linearized algorithm the refinement limit is increased so I will keep it in that fork.
Change-Id: I3407ae4d895c9910b6588dea5782ba4b6208ec7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290420
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
The dart2js snapshot is not meant to be invoked directly except from
a limited set of entry points (CLIs and internal build systems).
This change makes it an error to invoke it in unsupported ways.
Note: this change is not expected to be visible to end users.
Fixes#51695
Change-Id: I4013dd00b90bb3d54483e2f112e0ddfb8dc694e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289885
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Today we track and constantly update maps of distinct callers throughout the inference algorithm. Instead we can simply iterate over all call sites and set the `isCalledOnce` flag after all call targets have settled. This result is not used in inference, it is just saved out to the results for the member so the timing doesn't matter.
On a large program this shows a ~4% memory improvement and marginal runtime improvements (in addition to 4% from https://dart-review.git.corp.google.com/c/sdk/+/290060/6).
Change-Id: I403a5cfeba0d5c0175f40626d39ac05860769961
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290120
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Saves ~4% memory while compiling a large program with no apparent impact to runtime.
Change-Id: Ibc17041cba992b35f0ff6f76d0d422d968576c9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290060
Reviewed-by: Mayank Patke <fishythefish@google.com>