The spec has been updated so that the pattern type schema is only used
in irrefutable contexts, and consequently we don't need to come up
with a type schema for refutable patterns.
The prototype code already made these assumptions, so there is no
change, only comment updates.
Bug: https://github.com/dart-lang/language/issues/2458
Change-Id: I4179953fff24ad596d990ab0423fe35f8a010805
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
They were simply passing arguments to constructors.
Change-Id: Ic986d357902ea540c1de0c8b9f8b6a4cf1c8cdc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259646
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
I removed factory methods that are already unused, and update other.
Ideally we should use Token(s) in AstBuilder as well, but it was too
complicated right now, so I will try doing this later.
Change-Id: I2dcfa0b419818ba551401cd08b7c496ebb90c840
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259641
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Adds tests to check that various members are correctly mocked,
inheritance on both the Dart and @staticInterop side work as
expected with respect to mocking, and pkg:mockito can be used
with the new mocking functionality.
Change-Id: I7346339f15c14e934b045d75260c1e4540f89d0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257161
Reviewed-by: Riley Porter <rileyporter@google.com>
Bug: https://github.com/dart-lang/sdk/issues/49351
After static checks have passed, adds functionality for a JS
object literal to mock a @staticInterop class using a Dart
implementation. Fields, getters, setters, and methods' names are
added to the object literal, and their values are closures which
call the Dart mock's members.
Change-Id: Ie2ef27179eb79039d3aa28737b246c5091f4beb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257160
Reviewed-by: Riley Porter <rileyporter@google.com>
Adds tests for the following cases:
- Type arguments to createStaticInteropMock
- Missing members in implementing class
- Members that need to be implemented through inheritance
- Members that implement through inheritance and mixins
- Implemented members are correct subtypes
- Static checker checks for potential extension conflicts
Change-Id: I866ba47189d8f397fe6a934af1c5ecb0b231aa68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256422
Reviewed-by: Riley Porter <rileyporter@google.com>
Bug: https://github.com/dart-lang/sdk/issues/49351
Adds checks for the following cases:
- Type arguments to createStaticInteropMock are correct
- No missing members in implementing class
- Inherited and non-overridden @staticInterop members are implemented
- Dart class can implement through inheritance and mixins
- Implemented members are correct subtypes of @staticInterop members
- Potential extension member conflicts that are attempted to be
resolved through subtyping rules
Change-Id: Iacbe5846040ba7fab41459aa19be77351cf1efca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255761
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Change-Id: I5b2de0bda736abf89ba3f5f3a8300af9fbf68a6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259510
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
This change adds minimal support for RecordType, RecordLiteral,
RecordIndexGet, RecordNameGet and RecordConstant kernel nodes to TFA.
TFA is *not* yet extended with the ability to infer record types.
TEST=language/records/simple
Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I7c5eb860c6a5cb263e4d1bb55ad230e5c51f47c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259520
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This change provides baseline implementation of type checks involving
record instances and record types via runtime calls.
TEST=language/records/simple/type_checks_test
Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I2402f3db0a6dadbab477b073ed2b8861d5a172e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259460
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
I believe that this accounts for all of the changes to the proposal
that impact the AST structure. Let me know if you see something I
missed, though I'm sure we'll find any problems when we implement the
parser support.
If this looks good, then I plan to follow up with changes to the
constructors for `IfElement` and `IfStatement` and remove the
AstFactory methods.
Change-Id: I56937b3715d91b16a8f3a5cf45272278532b0bff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259201
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
In certain cases, VM can omit field setters for static fields as an
optimization. This change makes sure that setters are not omitted
if static field needs a null assertion.
TEST=language/nnbd/null_assertions/parameter_checks_fields_and_setters_test
(Borrowed from https://dart-review.googlesource.com/c/sdk/+/258220.)
Fixes https://github.com/dart-lang/sdk/issues/49940
Change-Id: I370bff7ad2d9dddb38c6c1b481684fdda09636ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258940
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Experiment with tool that finds duplicate code.
This still leaves a lot to be desired, but has already found something,
e.g. https://dart-review.googlesource.com/c/sdk/+/257400
It will probably need some iterations before running it on more than
one file would make sense.
Change-Id: I687e63e0a9003a8350df6682db279050d407605a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257401
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Will be used during call hierarchy analysis in combination with explicit call graph construction.
Currently typemasks do not support the `difference` operation and so we cannot fully narrow the type cones based on the call hierarchy. An implementation is included here of the applies-to set with subtraction of overrides.
Change-Id: I3f6c113787a4d26e9751added482791365c12832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259560
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
This is the latest version, which we can now update to after switching
the JS interop imports/exports in dart2wasm to use `externref`.
Change-Id: I102ca6e4b6d777cf490ee28cc36b46536ceff7dd
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258542
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Stephen Adams <sra@google.com>