var func6 : ((int,int) -> int) -> (); // Takes a function, returns nothing.
func funcdecl5() {
func6(_0 + _1); // Closure with two named anonymous arguments
}
into:
(apply_expr type='()'
(declref_expr type='(int, int) -> int -> ()' decl=func6)
(closure_expr type='(int, int) -> int'
(anondecl '_0' type='int')
(anondecl '_1' type='int')
(tuple_expr type='int'
(binary_expr '+' type='int'
(declref_expr type='int' decl=_0)
(declref_expr type='int' decl=_1))))))))
However, there are still some problems with this (and we're definitely not doing type inference yet, all anon args are assumed 'int').
Swift SVN r111
var closure1 : () -> int = 4; // Function producing 4 whenever it is called.
var closure2 : (int,int) -> int = 4; // Has some (dead) arguments.
into:
(vardecl 'closure1' type='() -> int'
(closure_expr type='() -> int'
(integer_literal type='int' value=4)))
(vardecl 'closure2' type='(int, int) -> int'
(closure_expr type='(int, int) -> int'
(integer_literal type='int' value=4)))
Swift SVN r101