This was intended to capture the set of variables captured anywhere in
a given function, but it doesn't actually work that way, because we
use a single AssignedVariables instance for the entire file. But
that's no problem; we can just track variables captured within the
function using AssignedVariables.capturedInNode().
Change-Id: I2c39f40029203f275cf9b3284c6077de089b91fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120501
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
In preparation for creating a clean implementable interface for various
builder classes. This is in turn a precursor for deprecating
Builder.target
Change-Id: I83910e84da149775f46c0be4b10f7694fadd0a7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119843
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Use interface ClassMember instead of Builder in ClassHierarchyBuilder.
This avoids the coupling between DelayedMember and Builder and is a
precursor to removing Builder.target.
Change-Id: Ie2067512051618a60fcb94b5aae7e7f3d8c02b15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119644
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
The interpretation of the subtype check result depends on the mode. In partial
NNBD mode all type errors that wouldn't be errors in non-NNBD programs should
become warnings. In full NNBD mode all such errors are errors. This CL adds
the mode explicitly to the interface of the subtype check as a parameter.
Bug: http://dartbug.com/38673
Change-Id: I14bcdd260618530cfdd8189c01abba7469a16679
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119545
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
It is no longer necessary to explicitly "add" variables that are
subject to flow analysis. Unrecognized variables are now treated
simply as uninitialized. This simplifies analyzer error recovery by
ensuring that an attempt to use a variable before its declaration
doesn't lead to a crash.
Change-Id: I11e8afc3ffb93c864db4638a224ff782d11f5a6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Pass variance data to field in TypeParameter through the listeners.
ast_to_text will print variances for classes and mixins if specified.
Avoids serialization/deserialization (impl in future CL).
Change-Id: I298537604823710f0d30001f4cb5f1e81530959f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118464
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
TL;DR: Use cases of 'legacy' constructor are covered by the 'omitted'
constructor.
The initial idea behind the removed constructor was to use it on all
types in opted-out libraries, as if the programmer had a way to specify
which type is legacy. That didn't prevent from building the 'omitted'
NullabilityBuilder into 'legacy' nullability sometimes. In some cases
we still had to use the 'omitted' constructor because we didn't have the
access to the library object yet, and then, then the
NullabilityBuilder.build method is invoked, and the library object is
passed to it, we build 'legacy' nullability.
Change-Id: I975fa93e23ee55e93db5f3e642a97ad6901b06c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118568
Reviewed-by: Johnni Winther <johnniwinther@google.com>
With the experiment flag on, will properly parse the `in`/`out`/`inout`
keywords. Without it, will issue an error regarding the flag. First CL
for parsing, syntax support, no AST work yet.
Keywords only parse correctly for classes and mixins.
See test `variance_disabled_syntax_test.dart`.
Change-Id: I37d765804fa0752512abf52fa44456a173087ef0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117929
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Previously the errors were reported using the synthesized name, like
`Extension|method` instead of `method`.
+ Report errors on invalid uses of explicit extension application as
an expression or lvalue.
Change-Id: I6d85430be4ab3966ee94131b37aa365265c07eac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118383
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Before this CL we would miss some dependencies when recording
dependencies because we cache certain calculations that upon calculation
can mark things as needed.
Change-Id: If9ff872021b0fb77cbcc787112bb91f3ade71243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118281
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Fixes the changes to assembly snapshot writer in SIMARM_X64 mode. This unfortunately can't be tested until the ELF loader is available.
Take 2 is in patchset 1.
Change-Id: Ib8b067dd4f09dcba3b142705e9cb4dfbf4e3eb53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117726
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This refactoring achieves the following:
- Collect the integer operation semantics into one place instead of
having it sprinkled all over the constant evaluator with many
"if (targetingJavaScript)" tests.
- Avoid emitting the internal JavaScriptIntConstant node, which is
serialized as normal DoubleConstant nodes, thus achieving parity
between direct consumers and consumers seeing output that has been
serialized.
- Implement the JavaScript semantics for unsigned right shift.
- Fix truncating divide with a result outside int64 range incorrectly
clamping the result for JS targets.
- Fix positive hex constants >= 2^63 through int.fromEnvironment
producing negative values in dart2js.
- Clarify in Kernel documentation how numeric constants are represented
on VM vs JS targets.
Change-Id: If30bb2c2c77c54eff120b611b059c2ec726c99a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116525
Reviewed-by: Mayank Patke <fishythefish@google.com>