Saw in crash log:
StateError: Bad state: No type: void
at ExpressionExtension.typeOrThrow (extensions.dart:89)
at MakeReturnTypeNullable.compute (make_return_type_nullable.dart:55)
Change-Id: Id985d7a2bb26fe9e494f3a36dc0b15196c6de463
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213412
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
1. Make unwrapException pure. This allows it to be removed if the
exception is unused, and ensures that the catch does not unnecessarily
invalidate locations. This is helpful since, by itself, this change
causes some test failures due to the load elimination bug (#47166).
2. Invalidate locations on entry to catch and finally blocks. This is
a conservative fix for #47166.
Bug: 47166
Change-Id: If3b4113b538978095d59814c16bd8375bbd70696
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213414
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
The WebSocket abstract class was changed to allow an optional parameter called customClient that takes in a HTTPClient and passes it to the WebSocket Implementation.
The WebSocket implementation takes the customClient, checks if its null, if its not null, it uses the customClient in place of the static HTTPClient that the WebSocket Implementation offers.
This custom client does not override the static HTTPClient, so all previous functionality remains the same when the customClient is not present.
TEST=testStaticClientUserAgentStaysTheSame() in web_socket_test.dart in standalone_2/standalone
TEST=new SecurityConfiguration(secure: true).runTests(); in web_socket_error_test.dart and web_socket_test.dart in standalone_2/standalone
Bug: https://github.com/dart-lang/sdk/issues/34284
Closes https://github.com/dart-lang/sdk/pull/46040https://github.com/dart-lang/sdk/pull/46040
GitOrigin-RevId: 58fed38baa606a8a492d3729190afa5009cc2409
Change-Id: I042b1e3fa7a4effed076c0deeec1f86af0dfe26d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200262
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This code is simpler and conceivably reduces memory usage.
Change-Id: Ic20a3ec05b60c557d829fc52a79589d6445e062d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213413
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
FlowGraphCompiler::CurrentTryIndex() always returns correct try_index,
even when generating slow path code. So we can cleanup passing of
try_index for slow paths.
Also, removed unnecessary arguments from EmitMegamorphicInstanceCall as
it is no longer called on slow paths.
TEST=ci
Change-Id: I2fc29914c0c45068c1732eac27f3da3fd4da6823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213411
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This required some refactoring of the message generator so that the
same targets object can be shared between the generator and the
checker.
Change-Id: I52bdfa08b75b15667b56d0fb65c93be6ff53b845
Bug: https://github.com/dart-lang/sdk/issues/44888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213402
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
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>