<div><div>Whilst trying to compile some code to core erlang I came across a problem when the target expression (e0 in spec) to apply was another apply expression. According to the spec I thought that would be ok however when compiling the .core file with erlc I got an "no_file: Warning: invalid function call" error.<div><br></div><div>What I then tried, not thinking it would work, was to wrap the inner apply expression in a let expression. This to my surprise worked just fine. I've included the code below. 'addSix` is the working function and `addSix2` is the dodgy one. Am I doing something wrong in `addSix2` to in terms of how I print my AST or is it simply that `addSix2` cannot be made to work? I also tried putting some parens around it but that also didn't work.</div><div><br></div><div><div>'add'/2 =</div><div>    fun (_a0,_b0) -></div><div>        call 'erlang':'+'(_a0,_b0)</div><div><br></div><div>'addFive'/0 =</div><div>    fun () -></div><div>        let <_a0> = 5</div><div>        in fun (_b0) -></div><div>    apply 'add'/2 (_a0,_b0)</div><div><br></div><div>'addSix'/1 =</div><div>    fun (_x0) -></div><div>        call 'erlang':'+'(let <_fez0> = apply 'addFive'/0 ()</div><div>in apply _fez0 (_x0),1)</div><div><br></div><div>'addSix2'/1 =</div><div>    fun (_x0) -></div><div>        call 'erlang':'+'(apply     apply 'addFive'/0 () (_x0),1)</div></div><div><br></div><div><br></div><div>Cheers</div></div></div><div><div><div>Karl</div></div></div>