File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 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 {
61066106 let local = < Local > target ;
61076107 signature = local . type . signatureReference ;
61086108 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+ }
61096118 if ( local . is ( CommonFlags . INLINED ) ) {
61106119 let inlinedValue = local . constantIntegerValue ;
61116120 if ( this . options . isWasm64 ) {
Original file line number Diff line number Diff line change 88 " $local0; // closure 2" ,
99 " AS100: Not implemented: Closures" ,
1010 " $local0; // closure 3" ,
11+ " AS100: Not implemented: Closures" ,
12+ " $local0(123); // closure 4" ,
1113 " EOF"
1214 ]
1315}
Original file line number Diff line number Diff line change @@ -21,4 +21,11 @@ function testLet(): (value: i32) => i32 {
2121}
2222testLet ( ) ;
2323
24+ function testFuncParam ( $local0 : ( x : i32 ) => void ) : ( ) => void {
25+ return ( ) => {
26+ $local0 ( 123 ) ; // closure 4
27+ } ;
28+ }
29+ testFuncParam ( ( x : i32 ) => { } ) ;
30+
2431ERROR ( "EOF" ) ;
You can’t perform that action at this time.
0 commit comments