| Issue 104: | Cannot return a function from inside a switch block. | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1. Compile the code below for the cpp target using the latest nightly compiler (not tested on previous ones).
2.
3.
What is the expected output? What do you see instead?
Should compile.
It generate an error in the output cpp generated code (cannot retrieve the closure to return).
Please complete the following class with minimal code reproducing the
problem :
class Test {
static function toto(x : Int) : Int -> String {
return switch (x){
case 5: function (x) return "Cinq";
};
}
static function main() {
}
}
Please provide any additional information below.
This is a show stopper for a broad range of valid haxe programs.
Mar 15, 2011
Project Member
#1
gameh...@gmail.com
Status:
Fixed
|