-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "[vm] Cleanup old async/async*/sync* implementation from the VM"
This is a reland of commit bc8afad On top of the original commit, this change fixes incorrect propagation of async/async*/sync* modifiers from a function to its dynamic invocation forwarder. TEST=ci, runtime/tests/vm/dart/regress_b_238653741_test.dart Fixes b/238653741 Issue: #48378 Original change's description: > [vm] Cleanup old async/async*/sync* implementation from the VM > > TEST=ci > > Issue: #48378 > Change-Id: I089ba4ed5613f30eec29f0db4ac6d5d8fbffd185 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249980 > Reviewed-by: Martin Kustermann <kustermann@google.com> > Reviewed-by: Slava Egorov <vegorov@google.com> > Commit-Queue: Alexander Markov <alexmarkov@google.com> Change-Id: Iaad033d974a23fc6c5880a3d7f41818eb117f839 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251300 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Slava Egorov <vegorov@google.com>
- Loading branch information
1 parent
91a9774
commit 61caeca
Showing
28 changed files
with
518 additions
and
1,615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
// Regression test for b/238653741. | ||
// | ||
// Verifies that calling async function through dynamic invocation forwarder | ||
// does not result in a runtime error. | ||
|
||
import "package:expect/expect.dart"; | ||
|
||
class A { | ||
Future<int> foo(int arg) async => arg + 3; | ||
} | ||
|
||
class B { | ||
Future<int> foo(String arg) async => int.parse(arg); | ||
} | ||
|
||
List<dynamic> objects = [A(), B(), 42]; | ||
|
||
void main() async { | ||
Expect.equals(7, await objects[0].foo(4)); | ||
Expect.equals(8, await objects[1].foo("8")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
// Regression test for b/238653741. | ||
// | ||
// Verifies that calling async function through dynamic invocation forwarder | ||
// does not result in a runtime error. | ||
|
||
// @dart=2.9 | ||
|
||
import "package:expect/expect.dart"; | ||
|
||
class A { | ||
Future<int> foo(int arg) async => arg + 3; | ||
} | ||
|
||
class B { | ||
Future<int> foo(String arg) async => int.parse(arg); | ||
} | ||
|
||
List<dynamic> objects = [A(), B(), 42]; | ||
|
||
void main() async { | ||
Expect.equals(7, await objects[0].foo(4)); | ||
Expect.equals(8, await objects[1].foo("8")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.