-
-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cpp] Fix return typing for embedded closures. Closes #6121
- Loading branch information
Showing
2 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package unit.issues; | ||
|
||
class Issue6121 extends unit.Test { | ||
|
||
public function add(t:Issue6121) : Issue6121 return this; | ||
|
||
public function start(run:Void->Issue6121) : Issue6121 return null; | ||
|
||
static public function setCallback( cb:Void->Issue6121 ) : Issue6121 return null; | ||
|
||
function callFunction() : Int | ||
{ | ||
setCallback(function () return add(setCallback(function() return start(function() return null)))); | ||
return 1; | ||
} | ||
|
||
function callBind() : Int | ||
{ | ||
setCallback(function () return add(setCallback(start.bind(function() return null)))); | ||
return 2; | ||
} | ||
|
||
|
||
function test() { | ||
eq(callFunction(),1); | ||
eq(callBind(),2); | ||
} | ||
} | ||
|