This reverts commit b4c19b93c9.
Reason for revert: http://b/199988795
Original change's description:
> Bump package:usage.
>
> Most of these are from a single PR that did not get squashed.
>
> Running `git log --format=%C(auto) %h %s e0780cd8b2f8af69a28dc52678ffe8492da27d06..016dd302b494e4ff70a7850957ec895eced9d220` in third_party/pkg/usage ✓
> 016dd30 Prepare release (#160)
> 076c653 Merge pull request #152 from sigurdm/batching
> 1d6b343 Remove debug print
> c073fb7 Use correct limit for bytes
> 1d89875 Send batch early if full
> 2896a85 Update README.md
> da20fab Delete travis.sh
> 7c351a3 Merge
> 0424091 Update build.yaml (#159)
> 4f2a050 Use a Duration for batching delay
> aa3f3ce address review
> 318ebe5 Fix
> 71ddec1 Send remaining hits on waitForLastPing
> 1c895a7 Parametrize client-id in test
> 0ae7733 Fix pubspec
> 2255b3d Merge remote-tracking branch 'origin/master' into batching
> 14d3702 Merge remote-tracking branch 'origin/master' into batching
> 1c3393d Handle batching implicit waiting for a 'batchDelay' future
> 219b764 TODO about size of payloads
> aaee6d9 Fix AnalyticsMock
> a8ec5b4 Remove mockito as dep - didn't use it
> e26fcce Allow batching of hits
>
> Change-Id: I801c0d9114fb90e1dc94c3e2552c1cd90a8f0c18
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213349
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
TBR=sigurdm@google.com,jonasfj@google.com
Change-Id: I3b044a1744bbe5aade9c75fecb9d057d6564ddda
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213440
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
Fixes#47190
TEST=None, only markdown files where edited.
Change-Id: Ife204f9c792b6bce30d0cd7bf2260ced11c8f2b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213049
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Before this CL:
If a library (say lib.dart) imports a file (say part.dart) that's
actually a part (of some other library (say main.dart)) an error is
given, but the "fake library" shortly representing the part is still
"linked" into the libraries dependency list.
This means that the component returned from a compilation is different
from the combination of libraries one can get to if walking all
LibraryDependency's. This also means that if we serialize the component
we can't load it back in (https://github.com/dart-lang/sdk/issues/46706).
It furthermore means that we have two different entities with the same
fileUri and importUri.
This CL rewrites a such import of a part to instead be an import of the
"parent", i.e. if a library lib.dart imports part.dart that's a part of
main.dart an error is issued, and the import is rewritten to be an import
of main.dart instead. The same thing happens to exports.
This alleviates the problems (i.e. no crashing if trying to load the dill,
no referenec to a otherwise non-existing library etc), and has the added
benefit of probably being what the user wants: Anything defined in
part.dart (that isn't private) is still in scope from lib.dart.
Change-Id: I17aca9db4edbf25b23d3ef301cf65589eeeb1635
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213344
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This code is a little weird because of how this type instantiation
works:
```
typedef Fn<T> = void Function(T);
var x = Fn<int>.foo;
var y = (Fn<int>).foo;
extension on Type {
int get foo => 1;
}
```
`x` is illegal under any circumstance, because calling a getter on a
type instantiation can _only_ resolve to a constructor, but function
types do not have constructors. But it's nice to resolve what we can,
and what the user may have meant, and we have to represent
`Fn<int>.foo` _somehow_. So it's a property access on a TypeLiteral.
Add two new codes because it is not correct to say that `foo` is not a
getter on 'Type' because that is beside the point. The issue is that
there is no possible getter on a type-instantiated type literal of
a function type alias (nor method, nor setter).
Add lots of tests, for calling a method, a getter, and a setter on a
function type alias literal. Add tests with prefixes, bounds, too
many and too few args.
Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: Icdf17506a64b3382226c5e50786784130d9e3bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213287
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Failing analyzer test cases which should reference an error
code with a shared code might print:
Expected but did not find:
CompileTimeErrorCode.UNDEFINED_SETTER [58, 3]
Found but did not expect:
UNDEFINED_SETTER_ON_FUNCTION_TYPE [58, 3, The setter 'foo' isn't defined for the aliased function type.]
To accept the current state, expect:
error(UNDEFINED_SETTER_ON_FUNCTION_TYPE, 58, 3),
which is erroneous; `CompileTimeErrorCode.` is needed as well.
Change-Id: Ic44c38dfcd6e6158cf51d2ce9162567a0f8c0006
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
The recent change in `findFile` that uses the `bazel-bin`
symlinks was not supported by `findPackageFor` since the `blazeBins`
list would not necessarily contain the symlink path (we only added it
if there were no other paths). The user visible symptom of this was
that we would suggest importing packages with `package:blaze-bin.`
prefix.
I believe that we can simply always add the symlink as the last element
of `binPaths`, so that we recover the property one of its elements
corresponds to the generated file that we have found.
Bug: http://b/193636339
Change-Id: I818379b4770a477cbcb6b147a505f1f3c012bb6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213046
Commit-Queue: Michal Terepeta <michalt@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 sgrekhov@unipro.ru Fixes 1196. Roll failures fixed and issue numbers added
2021-09-14 sgrekhov@unipro.ru Fixes 1195. Typo in error expectations fixed
2021-09-14 sgrekhov@unipro.ru Use '/' as a path separator when working with Uri
2021-09-13 sgrekhov@unipro.ru Fixes 1193. Add constant expression tests for explicit generics instantiation
2021-09-10 sgrekhov@unipro.ru Fixes 1191. Call method tests updated according to the changed spec
2021-09-10 sgrekhov@unipro.ru Update expectations according to the SDK issue 47060
2021-09-10 sgrekhov@unipro.ru Fixes 1194. Use more precised function type in Expect statement
2021-09-08 sgrekhov@unipro.ru Fixes 1192. call_method_* tests updated. Assertion actualized, new tests added
2021-09-07 sgrekhov@unipro.ru Fixes 1192. Fix call_method_A03_t01.dart test and make it to do some generic function instantiation
2021-09-07 sgrekhov@unipro.ru Fixes 1190. Isolate entry point is allowed to be a local function or instance method now
Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I011bfc05b652ca7e941d3aed3b448a7dbc098fae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213350
Reviewed-by: William Hesse <whesse@google.com>
So, consistently with analyzer/, by default enable everything, and
disable with WithoutNullSafetyMixin as necessary.
Change-Id: I89079d3c1122a14ad338aa8f0d8008086a1fcb89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213295
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Most of these are from a single PR that did not get squashed.
Running `git log --format=%C(auto) %h %s e0780cd8b2f8af69a28dc52678ffe8492da27d06..016dd302b494e4ff70a7850957ec895eced9d220` in third_party/pkg/usage ✓
016dd30 Prepare release (#160)
076c653 Merge pull request #152 from sigurdm/batching
1d6b343 Remove debug print
c073fb7 Use correct limit for bytes
1d89875 Send batch early if full
2896a85 Update README.md
da20fab Delete travis.sh
7c351a3 Merge
0424091 Update build.yaml (#159)
4f2a050 Use a Duration for batching delay
aa3f3ce address review
318ebe5 Fix
71ddec1 Send remaining hits on waitForLastPing
1c895a7 Parametrize client-id in test
0ae7733 Fix pubspec
2255b3d Merge remote-tracking branch 'origin/master' into batching
14d3702 Merge remote-tracking branch 'origin/master' into batching
1c3393d Handle batching implicit waiting for a 'batchDelay' future
219b764 TODO about size of payloads
aaee6d9 Fix AnalyticsMock
a8ec5b4 Remove mockito as dep - didn't use it
e26fcce Allow batching of hits
Change-Id: I801c0d9114fb90e1dc94c3e2552c1cd90a8f0c18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213349
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Some usages of `callConstructor` will have unnecessary checks
removed, when checks on the arguments can be elided. The
compilers will optimize further if they can.
Example optimizations: https://paste.googleplex.com/4594240957972480
Change-Id: I0e6e7e4d1268580cbfab84599b1c9da6fc64e7c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213114
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
This is a reland of 681e292b02
Original change's description:
> [dart2js] Enable by default and remove the
> --experiment-late-instance-variables flag.
>
> Change-Id: Ibb3cfa6d7b02883c82909930f7eb1142803dbc0f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200902
> Commit-Queue: Mayank Patke <fishythefish@google.com>
> Reviewed-by: Stephen Adams <sra@google.com>
Change-Id: If4d3c12e7f6a71d2c305283597b679e8b925493c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206980
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Treating createSentinel as returning a value of type Never caused issues
whenever its result flowed into a union, since the union would just
simplify to its other component. This meant that if a late field started
out uninitialized and was later initialized to a constant, we would see
it as only ever having the constant value. This caused isSentinel to
always return false even if the field hadn't been initialized yet.
Instead, we support a late sentinel value in the abstract value domain
and use this value as the return type of createSentinel during
inference. Additionally, inference treats _lateReadCheck as a simple
narrowing to exclude the late sentinel value.
Change-Id: I086bfd77576930e3ca2a4cfc9bd63476b6636685
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210646
Reviewed-by: Stephen Adams <sra@google.com>
* When testing for pragmas in the inliner, call function.has_pragma()
early to avoid more expensive Library::FindPragma query.
* When scanning through object pool entries in
Precompiler::AddCalleesOfHelper, skip over OneByteString and null
objects quickly. They are leaf and there could be a huge number of
those objects.
AOT gen_snapshot time of a large Flutter application built in
flutter/release mode for arm64 (best of 5 runs):
Before: 81.589s
After: 74.415s (-8.79%)
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/43299
Change-Id: I960451c73b42dab9845f0e0eafacaa9bb23720e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213288
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Helper methods for locations in constructors (`super` not available)
were missing type information for the tearoff. This replaces the use
of a helper that would itself would be torn off.
Added a new form of helper method that performs the tearoff and
binds the type. NOTE: Generic type arguments are still applied
outside of the helper.
Change-Id: I8dafe0d8357ecc9e1d070046a82e9e83e1a16ed9
Fixes: https://github.com/dart-lang/sdk/issues/47175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212861
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
When loading a value of a static final field with trivial initializer
generate a Constant instruction instead of LoadStaticField.
Initializer of a static field is considered trivial if it is null, int,
double, String or bool literal.
TEST=vm/cc/StreamingFlowGraphBuilder_StaticGetFinalFieldWithTrivialInitializer
Fixes https://github.com/dart-lang/sdk/issues/47120
Change-Id: Id2bfc3da8c14376f7f1ef829265cca29a018bad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212873
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Check for odd case of attempting to type instantiate an extension (it's not supported).
Re-write some TODOs as comments.
Change-Id: I14fd2a4e21139939ca60e415be9ac31b93ea50ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>