Elimination of redundant type cast 'x as Function' where x is
a function type (such as 'void Function(int)') is not correct because
it changes semantics of a function call if such expression is
used as a receiver.
"Function" static type of receiver allows arbitrary function calls,
while known function type of the receiver means the call doesn't
need to check parameter types. Static type of receiver is currently
not stored in kernel AST but calculated from the receiver node,
so replacing 'x as Function' with 'x' changes static type of
the receiver from "Function" to function type.
TEST=tests/language/regress/regress45428_test.dart
Fixes https://github.com/dart-lang/sdk/issues/45428
Change-Id: If7148450526703daa63a442adf67a9e7a2dcea54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193524
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Adds static errors in web backends requiring external members to be
annotated with @JS(). Members can be annotated directly, or on the
enclosing class or library.
Also removes duplicate checks in dart2js for non-native external
members that are now covered by the checks on external @JS members.
Change-Id: I2b17456f8f546f80f1ea6a817360c7f4c40f9640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
- Fix expectations for dart2js generic function types
- Split out Type canonicalization tests
- Do some partial checking for dart2js minification
Change-Id: Ifb6e38c1138311baf1a9852286e208c59aaa03fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107686
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Run `pkg/status_file/bin/normalize.dart` across all status files.
This should solve most presubmit warnings about "existing and possibly
new status file issues".
There are remaining issues in pkg/front_end/testcases/strong.status and
pkg/front_end/testcases/text_serialization.status which will need to be
fixed manually.
Change-Id: Iceae8992c4907442481590d75c1b0a84ce29521b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106726
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
This helps triage/resolve various issues in testRuntimeErrors:
* for_non_bool_condition_test isolates the code causing a crash on the
dart2js-production-linux-d8 configuration. (See
https://github.com/dart-lang/sdk/issues/36442 and the status file.)
* for_null_condition_test will be an approved failure for all dart2js
configurations due to https://github.com/dart-lang/sdk/issues/36446.
* for_runtime_error_test contains all the remaining expected type
errors. On the dart2js-production-linux-d8 configuration (which runs
with -O3), we assume no type errors exist - even ones guarded by
Expect.throwsTypeError - so the optimized code produces runtime errors
instead. See https://dart-review.googlesource.com/c/sdk/+/97820 for a
similar discussion.
* for_test contains the remaining tests, which are valid on all dart2js
configurations.
Change-Id: Ifef4f7d2e27e2731cdd4a3fec03754ea63b6328d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98606
Reviewed-by: Bob Nystrom <rnystrom@google.com>
This feature is under development in the front end. Testing it on the
runtimes leads to numerous spurious status changes. Skip the tests
for now. The intent is that when a backend change causes a test to
start passing, then that test will be un-skipped.
Change-Id: I6c8c1f45315607039240c3edc61ba8340ae9cda0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96902
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
once we accept the flag.
Note: 3 tests are missing compile-time errors from the CFE. This is a known CFE
issue, we need to mark the tests as failng using the new workflow before we land
the CL.
Change-Id: I0eaf6c1d7e903e035c83d3338054a8f92d2d9296
Reviewed-on: https://dart-review.googlesource.com/c/88763
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This reverts commit a0d576e6cd.
Reason for revert: Turned many buildbot builders red. Use the "Choose tryjobs" button to run more configurations on this type of commit. Use the "tools/bots/approve_results.dart" tool to update expectations for builders running the new workflow
Original change's description:
> Add more tests for async*/await-for operations.
>
> Change-Id: I2c8ffb8a6738b8dee43cfdf85be0c54d2735b6cc
> Reviewed-on: https://dart-review.googlesource.com/c/85391
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>
TBR=lrn@google.com,leafp@google.com
Change-Id: I81830c3fc565b62e98538feba9bd64c6dd11dd51
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/86023
Reviewed-by: William Hesse <whesse@google.com>
class in a foreign library.
This CL changes the predicate which is used to decide whether to
generate noSuchMethod forwarders such that it returns true whenever
the class in question has a user defined no such method or the
enclosing library of the class is different from that of the member.
Closes https://github.com/dart-lang/sdk/issues/33727
Change-Id: I0ffcbb8c8bdd69e4261bcefce2251d31babc19cf
Reviewed-on: https://dart-review.googlesource.com/c/79209
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>