mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:37:12 +00:00
[dart2js] Add regression test for #52825
I still haven't found yet the fix for this, but might as well add the regression test for it. Change-Id: I84821f6615a26faf95e6f7c498aa3670f5d48a54 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312701 Reviewed-by: Stephen Adams <sra@google.com> Commit-Queue: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
parent
1199dc09b7
commit
8171191413
17
tests/web/regress/issue/52825_test.dart
Normal file
17
tests/web/regress/issue/52825_test.dart
Normal file
|
@ -0,0 +1,17 @@
|
|||
// Copyright (c) 2023, 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: inference error when returning a closure from an async
|
||||
// function.
|
||||
//
|
||||
// For details, see: https://github.com/dart-lang/sdk/issues/52825
|
||||
|
||||
Future<double Function(int)> get getter async =>
|
||||
// The parameter `p` in this closure is accidentally treated as having
|
||||
// an empty type mask. As a result `.toDouble` is tree-shaken.
|
||||
//
|
||||
// Adding an `await` circumvents this issue.
|
||||
(int p) => p.toDouble();
|
||||
|
||||
main() => getter.then((double Function(int) f) => f(1));
|
Loading…
Reference in a new issue