Skip to content

Commit

Permalink
print arrow functions correctly in haxe.macro.Printer HaxeFoundation/…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Jun 27, 2020
1 parent 32e79ee commit f7215ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/Test.hx
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,10 @@ class Test extends haxe.unit.TestCase {
}

function testArrowFunctions() {
peq("class C { var f = () -> Math.random(); }", "class C {var f = function() return Math.random();}");
peq("class C { var f = (i) -> i * i + 2; }", "class C {var f = function(i) return i * i + 2;}");
peq("class C { var f = (i:Int) -> i * i + 2; }", "class C {var f = function(i:Int) return i * i + 2;}");
peq("class C { var f = (i:Int, j:Float) -> i * j + 2; }", "class C {var f = function(i:Int, j:Float) return i * j + 2;}");
peq("class C { var f = () -> Math.random(); }", "class C {var f = () -> return Math.random();}");
peq("class C { var f = (i) -> i * i + 2; }", "class C {var f = i -> return i * i + 2;}");
peq("class C { var f = (i:Int) -> i * i + 2; }", "class C {var f = (i:Int) -> return i * i + 2;}");
peq("class C { var f = (i:Int, j:Float) -> i * j + 2; }", "class C {var f = (i:Int, j:Float) -> return i * j + 2;}");
peq("class C { var f:Int -> Int; }", "class C {var f : Int -> Int;}");
peq("class C { var f:Int -> Float -> Int; }", "class C {var f : (Int, Float) -> Int;}");
peq("class C { var f:(i:Int) -> Int; }", "class C {var f : (i:Int) -> Int;}");
Expand Down

0 comments on commit f7215ff

Please sign in to comment.