File tree 3 files changed +18
-0
lines changed
3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -6106,6 +6106,15 @@ export class Compiler extends DiagnosticEmitter {
6106
6106
let local = < Local > target ;
6107
6107
signature = local . type . signatureReference ;
6108
6108
if ( signature ) {
6109
+ if ( local . parent != flow . parentFunction ) {
6110
+ // TODO: closures
6111
+ this . error (
6112
+ DiagnosticCode . Not_implemented_0 ,
6113
+ expression . range ,
6114
+ "Closures"
6115
+ ) ;
6116
+ return module . unreachable ( ) ;
6117
+ }
6109
6118
if ( local . is ( CommonFlags . INLINED ) ) {
6110
6119
let inlinedValue = local . constantIntegerValue ;
6111
6120
if ( this . options . isWasm64 ) {
Original file line number Diff line number Diff line change 8
8
" $local0; // closure 2" ,
9
9
" AS100: Not implemented: Closures" ,
10
10
" $local0; // closure 3" ,
11
+ " AS100: Not implemented: Closures" ,
12
+ " $local0(123); // closure 4" ,
11
13
" EOF"
12
14
]
13
15
}
Original file line number Diff line number Diff line change @@ -21,4 +21,11 @@ function testLet(): (value: i32) => i32 {
21
21
}
22
22
testLet ( ) ;
23
23
24
+ function testFuncParam ( $local0 : ( x : i32 ) => void ) : ( ) => void {
25
+ return ( ) => {
26
+ $local0 ( 123 ) ; // closure 4
27
+ } ;
28
+ }
29
+ testFuncParam ( ( x : i32 ) => { } ) ;
30
+
24
31
ERROR ( "EOF" ) ;
You can’t perform that action at this time.
0 commit comments