For a few months the "original" flutter gallery has had compile errors
and the weekly bot has been a lot slower (and doesn't really test the
default "advanced invalidation").
This updates the compile target to the one in
flutter/dev/integration_tests/new_gallery which doesn't have compile
time errors.
Change-Id: I59aa701700bc6b3530d73d9c0474dbff525288c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430700
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This CL includes changes to BenchMaker and test type parser that
include recent developments in the DartType system, such as extension
types and record types, outstanding existing features, such as
typedefs, and recent changes in the CFE type model, such as structural
parameters.
Change-Id: I16ca13273e83de7942abad67b8a2b67146fb24bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430661
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This combines the creation SourcePropertyBuilder for fields, getters,
setters, enum elements and primary constructor fields through the same
method.
This prepares for combining getter/setter and final field/setter
pairs in the same SourcePropertyBuilder.
Change-Id: I664ccded46c79235281cbd0799f9567bfb451eb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430440
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This adds a UriOffsetLength that passes uri, offset and length of a source locations. This is used to support
field/getter/setterUriOffset to prepare for getter/setter and final
field/setter pairs to be contained in the same builder object, while
still allowing messaging to point to the specific aspect.
UriOffsetLength is furthermore used on ClassMember which improves the
precision of messages from hierarchy checks.
Change-Id: I0776c8b66177164e326d3fb61e32a7620955f4c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429961
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Mixin transformation copies members of a mixin into a mixin
application class. Copied members should still behave similarly to
original members in terms of overriding.
When validating a dynamic module, overriding a copy of mixin
member should be allowed if original member can be overridden.
When annotating AST with dynamic interface pragmas, can-be-overridden
pragmas should apply to all copies of mixin members.
TEST=pkg/dynamic_modules/test/data/override_mixin_method
Fixes b/418681054
Change-Id: I038ff2133ef6f0c288a47cec7300c6ac4b23cbab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429423
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This changes the implementations of NameSpace to use a map of type
Map<String, LookupResult> internally instead of two getables/setables
maps of type Map<String, NamedBuilder>.
This is done in preparation for combining getter/setter and final field/
setter into a single PropertyBuilder object.
Change-Id: I4c1b95db17ff08ba136c20c52a8677a28c6a99a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429363
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This remove the iterators from the NameSpace interface and instead
collects the list of builders belonging to a library or declaration
directly inside these builders.
Adds ComputedNameSpace for import, export and prefix name spaces. This
allows for replacing a member and has a filteredIterator function. These name spaces are computed from import/exports and therefore need to be iterated through directly and replace builder when two builders collide.
Change-Id: Iec974656c5331498aa1cfca7973300ac6e044994
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428820
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This adds assertions to NameSpaceImpl.addLocalMember to ensure that the name space entries are not overwritten unexpectedly.
The computations of library and declaration name spaces from dill are changed to exclude private members from other libraries which might otherwise replace exiting members.
To support private class members inherited from other libraries as
of the member hierarchy computation, the member builders in a dill
class builder are kept separately from the name space.
Change-Id: Ib6b24e539a838093a3a5a2abfc056dfc3883903c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427701
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This remove part of the NameSpace to avoid an overreliance on its implementation. This is done in preparation for hold the name space content in a single map instead of a separate map for getables and setables.
The NamedBuilder interfaces is added to use for Builders that can be mapped in name spaces. This avoids the need for the NameIterator and all the associated methods.
Change-Id: Ia547bdc8ddcb83f47473b51a2059428b352f8916
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428001
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
For some erroneous programs the CFE produces the code that's not
type-safe or valid from the standpoint of a correct program. That
should not trigger the verifier warnings though.
Change-Id: I78b51ccffb0a74658926728e1a7ee3bf56934fe6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426500
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
This unifies the handling of getter/setter/field references into one object. The references for internal parts of the late lowering are removed. These are not need because the member are never accessed from outside the library and all uses are therefore created together with the reference objects.
Change-Id: I9a18d9f18fa379ee73a74ebadebd473dcb1649aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426800
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This CL enables the same checks in the redirecting factories of
extension types as in redirecting factories of classes. Additionally,
this CL marks all of those erroneous constructors, in classes and in
extension type declarations, as erroneous.
Change-Id: Ic270324f05b6a8424c1ab9fbe9fe4f1d0b22a3fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425860
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Internal implementation members, like those used for the late lowering, are not real instance members on should not be part of the hierarchy member computation. These members are only called directly from within the members for which these are generated, so we don't need to add forwarders and stubs to handle calls from the outside.
Closes#49339
Change-Id: I4d87477243d4e015265c7bb200e1fb5431ae21f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424943
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This adds a `debugPrint` method along with methods to support automatic indentation.
The debug helpers are reexported inside package:analyzer and package:front_end for easy access.
Change-Id: I80a4103e6fb30a6b459551184916c3fa26591a20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425280
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This adds support for computing the qualified name for all extension and extension type members.
The `lowering_predicates_test.dart` is removed and testing is performed through `predicate_test.dart`.
Change-Id: I334bb85d48b6b1fd8fa01de6576f61168b3e96fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424443
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This adds *FragmentDeclaration interfaces for member declaration in order to separate the interface used by the enclosing builder (which is shared between both syntactical and synthetic declarations) and by the body builder context (which is only needed for syntactical declarations). This also prepares for implementing the getter/setter aspect of a field fragment through the GetterDeclaration/SetterDeclaration interfaces.
Change-Id: I314dfe084b2c9d48782d2f6a0c1ae20ff5f7d8c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424821
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
In order to simplify creating dynamic interface yaml files,
the following is added to dynamic interface by default:
callable: dart:core, pragma._
extendable: Object
TEST=pkg/dynamic_modules/test
CoreLibraryReviewExempt: no API changes, only adding pragmas
Change-Id: I925532c4c024ebbcf4972b00be0e0a080d5878fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/422024
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Instead of validating the erasure of an extension type,
validate that extension type declaration and type arguments
are specified as callable.
TEST=pkg/dynamic_modules/test/data/extension_type2
Fixes b/411433443
Change-Id: I063f0a622abd0d75594c4095573b29a7888f5afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423882
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This cleans up and removes a lot of Builder properties in order to prepare for fields, getters and setters sharing the same PropertyBuilder object.
The PropertyBuilder interface is extended with field, getter and setter quality aspect to encode the various ways these can be declared.
Change-Id: I778ac9f2f8c288010beb00bea2525b89685a9df4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424060
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Dynamic module validation now accepts reference to classes and members
from 'dart:*' libraries if they are annotated with
dyn-module:language-impl:* pragmas. This matches the behavior of
dynamic interface annotator.
This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/418663.
Also, when checking for possible dynamic overrides in TFA,
treat _enumToString from dart:core as a public name because
front-end desugars enums into classes which override
private _enumToString method in a different library.
TEST=pkg/dynamic_modules/test/data/enum
Fixes b/395992622
Change-Id: I45ed9855f806224a510fa4e56962607de3371eb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423820
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This change updates the flow analysis logic for null check patterns,
so that when the language feature `sound-flow-analysis` is enabled,
the matched value type is checked for nullability. If it's
non-nullable, then the null check pattern is known to succeed.
There is no behavioral change if the feature `sound-flow-analysis` is
disabled.
Bug: https://github.com/dart-lang/sdk/issues/60438
Change-Id: Ie68d98d95e30053f992a3f8db6ccdd3978960eb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421583
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Uri.base, Platform.script and dart:io operations use the drive letter capitalization of the current working directory, but git, alas, does not. This normalizes the computeRepoDir to match that of Uri.base, thus avoiding spurious errors on Windows.
Change-Id: If4324874fa9b5c73c679c1b67a9481371ce8808d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421161
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This replaces the individual lookups of getables and setables in LookupScope and NameSpace with single lookup that returns a LookupResult holding both the getable and the setable. This prepares for having getter/setter pairs in the same SourcePropertyBuilder and avoids the need for AccessErrorBuilder for handling lookups of getters where only setters exist and vice versa.
Change-Id: I2b1e2477ed43506d9f94c48acd4b44277b490540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420080
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This change updates the flow analysis logic for `is` and `as`
expressions so that when the language feature `sound-flow-analysis` is
enabled, the static type of the operand is compared to the type to the
right of the `is` or `as` keyword. If one of the types is non-nullable
and the other type is `Null`, then the type test is known to fail. For
an `as` expression, this means that the code path following the
expression will be marked as unreachable. For an `is` expression, this
means that any code paths that assume it evaluates to `true` will be
marked as unreachable.
Note that these new behaviors break assumptions made by three
pre-existing flow analysis tests. I was able to adjust one of the
tests ("equalityOp_end does not set reachability for `this`") to
preserve its old behavior. The other two tests became redundant, so I
removed them.
There is no behavioral change if the feature `sound-flow-analysis` is
disabled.
Bug: https://github.com/dart-lang/sdk/issues/60438
Change-Id: Ib3a9e96bd39cf7df4c6c297568763c0f25bc9e39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420164
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Introduce a helper library to trim components based on what we believe
it is needed for modular bytecode compilation. The script is configured
to accept a set of entry points, so unreachable libraries can be removed
entirely. The contents of the retained libraries is trimmed to remove
method bodies, constructor bodies, and initializers, except for where
they may be needed.
In the near future, this should be expanded to:
* include proper unit testing in the CFE
* review whether additional trimming operations can be made
* consider an explicit representation of trimmed content, to help the
CFE recover when assumptions are not met (e.g. sentinel markers
to establish whether a value has been trimmed)
* CFE produces trimmed data directly if needed, without having to first
produce the full dill.
Tests that specifically stress that we don't over-trim include:
apply_mixin (requires preserving method bodies), const_body (requires
preserving initializers).
TEST=existing and new e2e dynamic module aot tests.
b/394936876
Change-Id: I26db8385bdfe1664b2aea234ec8bb896c7c21230
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418702
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
With the Builder model refactoring this test made less and less sense on its own. Removing the test enables the removal for properties that don't fit well with the new Builder model. The existing tests have been converted to expectation tests to preserve test coverage.
Change-Id: I0234a110321187870ad969236f58aae634f614cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418022
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This implements the _enumToString synthetic method using MethodDeclaration and SourceMethodBuilder instead of SyntheticMethodBuilder.
Change-Id: I71bcb38b86f84d9ee7b187022c528da756691bed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417821
Reviewed-by: Jens Johansen <jensj@google.com>