-
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.
[dart2wasm] Fix compiler bug regarding
void
values that can be obse…
…rved Issue #54800 Change-Id: I26b8c35f60955ee46eeae19797aab7e6c84bf354 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350580 Reviewed-by: Slava Egorov <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
- Loading branch information
1 parent
5a38644
commit 967dfe6
Showing
2 changed files
with
26 additions
and
14 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
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,26 @@ | ||
// Copyright (c) 2024, 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. | ||
|
||
import 'dart:async'; | ||
|
||
import 'package:async_helper/async_helper.dart'; | ||
import 'package:expect/expect.dart'; | ||
|
||
void main() async { | ||
asyncStart(); | ||
testVoid(); | ||
await testFutureVoid(); | ||
asyncEnd(); | ||
} | ||
|
||
void testVoid() { | ||
void x = int.parse('42'); | ||
Expect.equals(42, x as dynamic); | ||
} | ||
|
||
Future testFutureVoid() async { | ||
final controller = StreamController(onCancel: () async => int.parse('42')); | ||
final subscription = controller.stream.listen(null); | ||
Expect.equals(42, (await subscription.cancel()) as dynamic); | ||
} |