File tree 1 file changed +18
-0
lines changed
tests/cases/conformance/types/typeRelationships/typeInference
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
// @strict : true
2
+ // @target : esnext
2
3
3
4
declare const b : boolean ;
4
5
declare const s : string ;
@@ -51,3 +52,20 @@ foo(x);
51
52
52
53
declare function bar < T > ( x : T , y : string | T ) : T ;
53
54
const y = bar ( 1 , 2 ) ;
55
+
56
+ // Repro from #32752
57
+
58
+ const containsPromises : unique symbol = Symbol ( ) ;
59
+
60
+ type DeepPromised < T > =
61
+ { [ containsPromises ] ?: true } &
62
+ { [ TKey in keyof T ] : T [ TKey ] | DeepPromised < T [ TKey ] > | Promise < DeepPromised < T [ TKey ] > > } ;
63
+
64
+ async function fun < T > ( deepPromised : DeepPromised < T > ) {
65
+ const deepPromisedWithIndexer : DeepPromised < { [ name : string ] : { } | null | undefined } > = deepPromised ;
66
+ for ( const value of Object . values ( deepPromisedWithIndexer ) ) {
67
+ const awaitedValue = await value ;
68
+ if ( awaitedValue )
69
+ await fun ( awaitedValue ) ;
70
+ }
71
+ }
You can’t perform that action at this time.
0 commit comments