The uses the #type handle to pass the DartType in the message rather
than using the toString() method which doesn't give the desired result.
Change-Id: Iac17507643a9932570d5975a106a3ededc03f58c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316585
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
DartType.== was declared abstract, expecting subtypes to call
the `equals` method, but this was accidentally omitted for
ExtensionType.
This CL moves the implementation to DartType.== since it was called
with the same arguments in all subtypes, thus ensuring that new
DartType classes will get the correct equals by default.
Closes#53046
Change-Id: Ieaaf33ecb569ea7361ac338066a3a5760391e424
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316583
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
The `collectContexts(member)` already visits initializer lists when
visiting constructors, so no need to call it separately for
initializers.
Change-Id: Ida51a0e8c4003f19cd7b533a2847946926237bc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317101
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This renames InlineClass to ExtensionTypeDeclaration, and InlineType
to ExtensionType. Members of extension type declarations are called
extension type members instead of extension type declaration members
for "brevity".
TEST=existing
Change-Id: I91ed62533ddd345644492f04dc3310d007460288
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316780
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Flipped the ordering of the equality operation so that the compiler
can see it is being dispatched to a string literal and can generate
a faster check.
Change-Id: I5c2f6b123ebe0f6cb81efba94fe4bf81168bec74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317261
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reverting previous change since it does break some other parts of g3. Shortcircuiting the `??` isn't sufficient in some cases. So we attempt to fix it further downstream.
This change does a check for unresolved types and ignores the cast since we can't tell what type it is anyways. Similar to what we do with type parameters and when we don't know the type.
The generators in g3 seem to emit a lot more InvalidTypes and this is necessary to avoid the errors now that we propagate errors upwards.
b/293326927
Change-Id: I172980dfd3338f27d0a57e156b15dd937619ff73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316841
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Since external APIs can only use primitives and JS types in static interop,
we should require that all type parameters on static interop APIs extend
another static interop type. This is the minimum required to ensure all
type parameters can be erased to JSValue. This only affects dart:js_interop
users and replaces the previous type parameter static error check.
Change-Id: Ia546874da73c808aa25deb8d54d581db783987df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316140
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Change-Id: Ida68ed3995c4db9be34fa0ce90b6683fc826f8a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315822
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
- Updates test infra to use the assets built by the new "ddc" build
targets.
- The old "dartdevc" targets are still present to avoid breaking
golem when this change lands.
- Old targets are still used when packaging assets for the SDK.
- Golem and the SDK packaging will be updated in following changes.
Change-Id: I1926e0c86833c812f5ed8355d7cd4df8740d79ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315224
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This CL mostly just moves code around. There are three broad changes in this CL:
1) Reify the builder / built pattern that exists implicitly in the existing code. Builders now live in `src/builder`, while the built ir lives in `src/ir`.
2) Reify the module subsections.
3) `pkg/dart2wasm` has been updated to use the new API.
There is only one minor logic change in the entire CL, we now defer serialization of a module until the bytes are actually required, as opposed to serializing eagerly.
This change is designed to make the wasm_builder more robust. By clearly delineating which parts of the AST are mutable and which parts are immutable, then it should make it easier for users of the wasm_builder to avoid undefined behavior, i.e. holding on to something that can change.
Change-Id: I676107b867aa74fabf413108673e170126bdb5c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316280
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
And using Future from dart:core, which was not enabled until Dart
2.1.0.
Dart 3's minimum language version is 2.12. google3's is 2.9.
Change-Id: Id31d92007e685447ff217bdccf8161c8fd6ce6e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316863
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This language feature allows type promotion to apply to private final
fields, e.g.:
class C {
final int? _x;
C(this._x);
}
f(C c) {
if (c._x != null) {
print(c._x.abs()); // (1)
}
}
Previously the line marked (1) would have needed to be written
`print(c._x!.abs());`.
Note that to ensure soundness, there are certain restrictions:
- Public fields don't undergo promotion (because a public field might
be overridden by a class in some other library).
- Non-final fields don't undergo promotion (because a non-final field
might be modified as a side effect of code executed between the type
test and the field's usage).
- Fields that are forwarded to `noSuchMethod` in the same library
don't undergo promotion (because there's no guarantee that
`noSuchMethod` will return the same value on every invocation). For
example:
class C {
final int? _x;
C(this._x);
}
class D implements C {
@override
noSuchMethod(...) => ...;
}
f(C c) {
if (c._x != null) {
print(c._x.abs()); // ERROR: `c._x` might dispatch to
// `D.noSuchMethod`, in which case there's
// no guarantee that it will return a
// non-null value the second time it's
// invoked.
}
}
- If two classes define fields or getters of the same name, and
promotion is not permitted for one of them, then it isn't permitted
for the other. This is because there might be a class in some other
library that's a subclass of both classes, causing a reference to
one field or getter to dispatch to the other. For example:
class C {
final int? _x;
C(this._x);
}
class D {
int? get _x => ...;
}
f(C c) {
if (c._x != null) {
print(c._x.abs()); // ERROR: `c._x` might dispatch to `D._x`
// (e.g. because some library might declare
// `class E extends D implements C`), in
// which case there's no guarantee that it
// will return a non-null value the second
// time it's invoked.
}
}
Change-Id: Ib9183581aa0194377e38ab70d37c3e9f0bb57a75
Bug: https://github.com/dart-lang/language/issues/2020
Tested: TAP global presubmit
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
There's a false positive with the `prefer_const_constructors` lint where
deferred constant values in const constructors were not being reported
as an error.
This change adds the new error so that the lint doesn't fire.
Fixes https://github.com/dart-lang/sdk/issues/48991
Bug: https://github.com/dart-lang/sdk/issues/48991
Change-Id: I378093c02ec63e0c5eb5a1a8d80c1bbb0c88ba2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316842
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Previously, --suppress-core-dump option was inserted into the beginning
of the command line and was effectively passed to fssh, which
doesn't understand this option:
./third_party/fuchsia/sdk/linux/tools/x64/fssh --suppress-core-dump run fuchsia-pkg://fuchsia.com/dart_ffi_test_release#meta/fuchsia_ffi_test_component.cmx --sound-null-safety -Dtest_runner.configuration=vm-fuchsia-release-x64 --ignore-unrecognized-flags --packages=/pkg/data/.dart_tool/package_config.json --disable-dart-dev /pkg/data/tests/ffi/callback_unwind_error_test.dart
Instead, it should be passed as the first argument after 'run ...cmx':
./third_party/fuchsia/sdk/linux/tools/x64/fssh run fuchsia-pkg://fuchsia.com/dart_ffi_test_release#meta/fuchsia_ffi_test_component.cmx --suppress-core-dump --sound-null-safety -Dtest_runner.configuration=vm-fuchsia-release-x64 --ignore-unrecognized-flags --packages=/pkg/data/.dart_tool/package_config.json --disable-dart-dev /pkg/data/tests/ffi/callback_unwind_error_test.dart
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try
Change-Id: Id33a4c54478b872889dcdd7034e9dae6336a3ae8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316620
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Fixes b/293426600
This synthetic procedure is added on every class with type args.
Mark it as synthetic so the JS interop checks don't trigger on
it.
Change-Id: I5b04fe4340b409a4ab1eb5c32e37fe6ff37df4b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316702
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Turns out the old code was also checking for the presence of the DEPS file.
This is not necessary, it was only done as a safeguard in case we had multiple
folders with the same name lying around. We could add DEPS to the set of files
sent to the shard, but that seems unnecesary here.
Fixes#53059
Change-Id: I83fc2569f42117c5fc4ea90c651cd7627a21a9ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316700
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Sorting is 2-3x faster for a 1024 element list and simple comparison function.
Change-Id: Iecb4dceb7155e430fcc2c0ddef977003d747ab9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315760
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
The findRoot method made assumptions that were only true when running the
test in the main shard of our test runners. This caused a few tests to
start failing when sharding was enabled in:
089364baabFixes#53059
Change-Id: I32c59d6ae396fba5cbf19491eb17d7b90a7b8cd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316642
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Revisions updated by `dart tools/rev_sdk_deps.dart`.
collection (db343da..0a2885a):
0a2885a 2023-07-25 Devon Carew prep for publishing 1.18.0 (#299)
dartdoc (a04ac3e..1cf8870):
1cf88707 2023-07-26 Sam Rawlins Convert 'p' prefixes to 'path' in tool/ (#3472)
d44c8056 2023-07-26 Sam Rawlins Move a few more grinder tasks to package:args commands (#3468)
f66eb72d 2023-07-26 Sam Rawlins Use path as import prefix in lib/ and test/ (#3471)
34441f21 2023-07-25 Sam Rawlins Move flutter-doc tasks to package:args; remove unused grinder tasks (#3466)
ecosystem (27ff3e9..97fc1a7):
97fc1a7 2023-07-25 Moritz Fix comment posting from forks (#144)
test (37e54e3..7f81dee):
7f81deea 2023-07-24 Nate Bosch Drop the Condition abstraction (#1956)
vector_math (048777a..88bada3):
88bada3 2023-07-26 John McCutchan Revert "Fix rotation around Y axis (#262)" (#300)
Change-Id: Ib7bc8c1bab60450e6b328c3075207adef4cf642b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316621
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Some part of the code generators trigger the `??` RHS operand when there is an unresolved type on the LHS.
In the previous const evaluator prior to https://dart-review.googlesource.com/c/sdk/+/312347, errors triggered by unresolved types would be ignored. Now that we have specific unresolved constants, we need to short circuit the evaluation in some places.
Anyways, this change makes unresolved types return LHS early (they're represented by a `Null` state) until I can find a better fix for this.
b/293326927
Change-Id: Ifcbff9921e1d4a82dc24153b042eaaa862bcca68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316490
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This removes ExtensionType, ExtensionTypeShowHideClause and
CallSiteAccessKind from package:kernel which where only used by the now
removed 'extension-types' experiment.
A follow-up CL will rename InlineClass/InlineType to
ExtensionTypeDeclaration/ExtensionType to match the names of the
Extension Type feature currently being implemented.
TEST=existing
Change-Id: I58d2e8b0a92ac61329ee161cc6884a2c0e6f87ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316420
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>