This was added before null safety, and before we had fully
defined the difference between Null, Bottom, and Never types.
I believe now this and Never.nonNullable are equivalent and
the distinction is no longer important to make. Hence, I'm
deleting it to reduce tech debt.
Originally this was added in https://dart-review.googlesource.com/c/sdk/+/88961
Change-Id: I64b3a8b01833bc60305eaecf430bfb249c8d2c98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301820
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Checks an interface's supertypes for final classes and produces an error if the implementing bypasses a legacy library.
This behaviour should only happen when a post-feature library implements
a pre-feature library declaration that has a final class as a super
declaration.
Similar error to https://dart-review.googlesource.com/c/sdk/+/298320
Bug: https://github.com/dart-lang/sdk/issues/52078
Change-Id: Ie16edb2b231957dad7502fdab3d5faba93bc6773
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300861
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Fix nits in documentation.
Add support for data driven fix for change parameter to non null.
Change-Id: I3120c74eb13e06640aa6ff0b9538e5552f7ae9f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298261
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
I ran the CL that does resolve with it in google3, it is mostly
green, but there are a few clients that extend TypeVisitor directly.
So, I want to publish the interface `InvalidType` first, update the
clients, and only then update the resolution.
Bug: https://github.com/dart-lang/sdk/issues/36697
Change-Id: I1f1c995a36849ebbde2c526bb8761d86be87b4ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
In https://dart-review.googlesource.com/c/sdk/+/299400, the parser was
adjusted so that it no longer accepts `when` and `as` as the names for
variable patterns in cases where there is a possible ambiguity
(e.g. `int when` is not accepted as a pattern because `int` is a
legitimate pattern, therefore `when` could introduce a guard
clause). This change further prohibits `when` and `as` from being the
names of variable patterns or identifier patterns even in the case
where there is no ambiguity. This is in line with the discussion at
https://github.com/dart-lang/sdk/issues/52199#issuecomment-1526297771,
and the spec change at
https://github.com/dart-lang/language/pull/3033.
Three new error codes are introduced, to cover the three circumstances
in which `when` or `as` might be used illegally: in a declared
variable pattern, in an assigned variable pattern, or in an identifier
pattern. I've also added analyzer tests to ensure that the parser
recovers from these errors nicely. Unfortunately, nice error recovery
is only feasible in the non-ambiguous cases.
I've also updated the language test expectations in
`tests/language/patterns/version_2_32_changes_error_test.dart` to
reflect the new error messages, and added a few more examples of uses
of `when` and `as` that are still permitted.
Fixes#52260.
Bug: https://github.com/dart-lang/sdk/issues/52260
Change-Id: I229f627aa639659c30b83c74895759207da279f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301482
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Revisions updated by `dart tools/rev_sdk_deps.dart`.
http (f581ff7..61dcb91):
61dcb91 2023-05-04 Brian Quinlan Switch to "dart format" from "flutter format" (#922)
test (9484592..1d65501):
1d65501b 2023-05-05 Jackson Gardner Don't do direct casts to int to prevent dart2wasm breakages. (#2007)
b6b4ddc5 2023-05-04 Nate Bosch Advise against eager matcher->checks migration (#2009)
4ef35d59 2023-05-04 Jacob MacDonald Re-enable wasm tests (#2008)
Change-Id: I457d009bf91da365d21cfb74e664d087a4aa6329
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302020
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
I'm actually not sure we are doing the right thing for general
aliases (that can now be nested arbitrarily deep), but at least
this commit avoids throwing an exception.
Change-Id: Ide3f7035b476f79fff5c542e2ddbb342045a874e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301983
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
Null-aware calls, like `v?.extMethod()` don't require `v` to be
non-nullable, even if `extMethod` was declared on a non-nullable type.
Tested: added a new test.
Change-Id: I113ecde21e480bcd467367d0954b721c2ad9f7e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301982
Reviewed-by: Paul Berry <paulberry@google.com>
It looks like it's failing as a result of my previous changes
to make public function/method arguments nullable by default.
I probably missed it, since it doesn't run with assertions
enabled.
Change-Id: Ifcf045d778302a0be771c3a75c94cec97cbf8060
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301981
Reviewed-by: Paul Berry <paulberry@google.com>
This repository is not used in the Dart SDK, and has been archived on GitHub.
Five years ago, it was still used in some tests, and was kept because of
that: https://dart-review.googlesource.com/c/sdk/+/49261
Those references are now gone.
Bug: b/278318858
Change-Id: Ife5f096b4057a25dc62f36d79ca54eda77f92287
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301960
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
This adds the static type of the switch statement expression to
the AST to better support optimizations based on the possible
runtime values of the switch expression.
TEST=existing
Change-Id: Ief35b687150401100d8c96721a026e9f0911b3b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301063
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Previously type tests involving type parameter types would
be replaced with native primitive tests when the type parameter
was bounded by a type with a native representation. This isn't
always correct because the type parameter can always be inhabited
by the bottom type at runtime. So code like `x is T` would be true
when `T` is instantiated as `Never` and `x` is any primitive value
like a number, string, or bool.
This change removes the incorrect optimization that allowed type
parameters to be replaced with their bound when that bound was
represented by a native type when performing an `is` operation.
Fixes: https://github.com/dart-lang/sdk/issues/52243
Change-Id: I57cebef7bb533d71831ef84415b3d91369758476
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300820
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
In DDC the types [num], [int], [double], [String], and [bool] used in
bounds caused an "optimization" in type tests that was incorrect when
passing a subtype as the type argument.
Issue: https://github.com/dart-lang/sdk/issues/52243
Change-Id: I0ae8d21c907cd923d62dbae257085545840a8cdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301140
Reviewed-by: Bob Nystrom <rnystrom@google.com>
I don't know how to write a test that ensures that we will attempt to
modify the collections after entering the for loop. Suggestions welcome.
Bug: https://github.com/dart-lang/sdk/issues/52263
Change-Id: Ifc13e80594bd08f6c485d8898eb7c75b31172992
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301780
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This should not actually matter, but we discovered
that LLVM code responsible for emitting compact unwind information
expects this specific ordering of CFI directives. If we don't
follow the order then LLVM fails to emit compact unwind info and emits
__eh_frame instead which is very large.
See https://github.com/llvm/llvm-project/issues/62574.
Fixes https://github.com/flutter/flutter/issues/126004.
Tested: manually via pkg/vm/tool/precompiler2 --build-assembly and objdump --unwind-info
Change-Id: Idb1f4f64afdaa7206bf43adf1685bb1f4086217f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301740
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Our helper function to detect whether a null-assertion was required
didn't include a case to check for record types.
The null-assertion flag is likely to go away soon, since it's
only valuable for mixed applications.
Fixes#52276
Change-Id: Ief4515b8c3eaae5343012da4220e6051bb5a2f19
Fixed: 52276
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301680
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
This switches the browser version to Chrome for Testing.
Cq-Include-Trybots: luci.dart.try:dart2js-linux-chrome-try,dart2js-mac-chrome-try,dart2js-minified-csp-linux-chrome-try,dart2js-win-chrome-try,ddc-canary-linux-chrome-try,ddc-linux-chrome-try,ddc-linux-chrome-unsound-try,ddc-mac-chrome-try,ddc-win-chrome-try
Change-Id: Id1bdacbadeab6eb34a535a31daac953fd3454da8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301520
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Required for upcoming deferred loading changes.
Our previous only stored this resolution logic for all componets except the
current component, which resulted in some empty deferred loads when referencing
modules in the main component.
Also adds a small type signature update missed in a previous commit.
Change-Id: I8511a39b26e1864919cc4882a6c008d2010354a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299381
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>