File tree 1 file changed +26
-0
lines changed 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ /// Regression test for https://github.com/dart-lang/sdk/issues/52593.
6
+ ///
7
+ /// Adding the value returned from a method with a static return type of `void`
8
+ /// to a record and getting the value should not cause a runtime error.
9
+
10
+ import 'package:expect/expect.dart' ;
11
+
12
+ (Object ? ,) fn1 () => (fn2 () as Object ? ,);
13
+ void fn2 () {}
14
+
15
+ @pragma ('dart2js:noInline' )
16
+ @pragma ('dart2js:assumeDynamic' )
17
+ confuse (x) {
18
+ return x;
19
+ }
20
+
21
+ void main () {
22
+ var r = fn1 ();
23
+ Expect .isNull (r.$1);
24
+ var d = confuse (fn1 ());
25
+ Expect .isNull (d.$1);
26
+ }
You can’t perform that action at this time.
0 commit comments