This changes the CFE expectation test suites to use unsound null safety
as default to avoid passing --enable-experiments=no-non-nullable to opt
out old test folders.
This change removes most test folders from the 'strong' tester, since
this now only supports sound null safety, which requires all libraries
to be opted in. Instead, the 'weak' tester now runs all test folders.
Additionally the 'outline' tester is changed to use unsound null safety
so that it call be used on all test folders.
The 'fast_strong' tester is removed since it should just be run locally
and it can be run by passing an option to the other testers.
References to non-existing 'shaker' folder has been removed from
testing.json.
Change-Id: Ibcc306f7b27d06b9637c205238bc408194f1d062
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184787
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
- make sure nested blocks scopes are visited
- make sure variable definitions do not leak beyond block scopes
- properly collect scopes for loops, if statements, constructors
- add calculation of fileEndOffsets for blocks
- save block file offsets to dill
- update binary format version
- change kernel readers and writers to read and write block offsets
- change vm readers to read and block offsets for new version
- add missing fileOffsets and fileEndOffsets on functions for
late fields
- add missing fileOffsets and fileEndOffsets on functions for
extensions
- add errors on failures to find scope
- find libraries for private fields correctly
- add more expression compilation tests
- add test to verify fileOffsets and fileEndOffsets are set for
SDK summary (will add full dill tests later)
Closes: https://github.com/dart-lang/sdk/issues/40278
Related: https://github.com/dart-lang/sdk/issues/34942
Change-Id: I5bc1bb645543045b689d8d61069ee77dc4ee9025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167541
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
If an expression compilation issues problems of any sort, they are saved
in the target-libraries problemsAsJson field. That's not ideal,
as it means that they can be re-issued later, as well as possibly being
serialized into the dill file.
This CL resets the problemsAsJson field of the real library,
thus fixing the issue.
Change-Id: I765c2cc50059c6bcda6a56bb749869dd4b181876
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96800
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
To get the same context on errors for expressions compiled against
something we just compiled and something we've loaded from dill we need
the dill to contain offsets on TypeParameters.
We cannot currently change the binary format to include it, so for now
ignore the context in expression_test.
Change-Id: Ifbcc4352650fc56974bf5a78d9eb615ecec34e39
Reviewed-on: https://dart-review.googlesource.com/c/92743
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Prior to f4379435dd,
using a type variable in an expression used for
expression compilation, where the type variable came from a class
that was loaded from dill would fail because type variables wasn't set
up so the type variable didn't exist in scope.
This adds a test for it - the actual fix was landed in
f4379435dd.
Change-Id: Icccf796b96853ece5ea96d4f29d76bb92b59fc83
Reviewed-on: https://dart-review.googlesource.com/c/92564
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This gets rid of the useless '#lib1::' prefixes on types in error
messages and instead adds a line to the error message for each
interface type appearing in the message stating where that type
originates.
Name clashes are disambiguated by appending markers like '/*1*/' and
'/*2*/' to the types whenever two interface types with the same name
appear in the same message.
The commonly used core types 'bool', 'num', 'int', 'double', 'String'
and 'Null' are excluded from the origin list unless they take part in a
name clash.
Change-Id: I017ea376d4f6ff2d4f3b36487774463f03bb3301
Reviewed-on: https://dart-review.googlesource.com/c/84604
Reviewed-by: Peter von der Ahé <ahe@google.com>
The CL is reverted because it didn't account for the case when a check
of a user-specified type argument against the bound depends on another
type that is only known after type inference is done.
Change-Id: I1fd140af95ed37b9191a5b161a281d4639e3453f
Reviewed-on: https://dart-review.googlesource.com/c/79048
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
If there are circular references between type parameters and types in the bounds,
currently serialization leaves original type parameters unchanged, which results
in failures to serialize compiled expression procedure.
This CL makes sure to clone all type parameters first, then passes map
with old-to-new type parameters to CloneVisitor.
Bug: https://github.com/dart-lang/sdk/issues/34052
Change-Id: Idf3e6e6e9099f93cdd7e970ab3b21921cdb29178
Reviewed-on: https://dart-review.googlesource.com/75241
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Bug: https://github.com/dart-lang/sdk/issues/33022
This commit adds an error when a final field is not initialized at all
(and there is at least one generative constructor). A later commit
will add an error for the case where a field is initialized by some,
but not all, generative constructors.
A number of classes in the Dart2js and DDC support libraries use
uninitialized final fields to indicate getters in the corresponding
native classes. This commit adds a temporary whitelist for the
affected files, which can be removed when the fields have been
replaced by external getters.
This is tracked by https://github.com/dart-lang/sdk/issues/33762
Change-Id: I6b5cee230c7cd5554da2b61da7ebddb6b0b9396e
Reviewed-on: https://dart-review.googlesource.com/63781
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
This arc of work is breaking the Flutter roll--see
https://github.com/dart-lang/sdk/issues/33993.
This reverts the following commits:
- 55c0857037 (Create a common generator class to handle non-lvalues.)
- c9b197017c (Rename "assignment_of" -> "assignment_to".)
- 32fd7b15e4 (Remove special case for assignment to parenthesized
expressions.)
- 432e59e589 (Fix error reporting if a for-in statement attempts to
assign to a prefix.)
- 232bed3d11 (Change UnresolvedNameGenerator to use
NonLvalueGenerator.)
- 0b778d0697 (Change IncompleteErrorGenerator to make use of
NonLValueGenerator.)
- 1a5f94a0a4 (Fix analyzer-CFE integration of illegal references to
instance members from static contexts.)
Change-Id: Id637e5ec60150a73031c05d7bb4c6effefd2aa8a
Reviewed-on: https://dart-review.googlesource.com/67091
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This avoids the need for custom assignment-handling logic in
KernelUnresolvedNameGenerator, and ensures that assignments to
unresloved names work properly with analyzer integration.
Change-Id: I802270987c90043d021f8560b56f47babf72fb1e
Reviewed-on: https://dart-review.googlesource.com/66701
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The behavioral difference is that named and optional arguments are filled in
with their default values in the `Invocation` object passed to `noSuchMethod`.
On the implementation side we make NSM forwarders concrete and fill in their
bodies in the CFE. The custom (and somewhat hacky) VM support is no longer
needed, and Dart2JS can benefit from this implementation as well.
According to discussion on #33031 we will be able to re-land this soon without
breaking Mockito.
Prior failures on precompiler bots are fixed in Patchset 2.
Change-Id: If1b7fe4cf6da5ef38f330e1ad226121bcfc958a1
Reviewed-on: https://dart-review.googlesource.com/54401
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>