http://d.puremagic.com/issues/show_bug.cgi?id=10212
Kenji Hara <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Segfault using wrong |Segfault in mismatching |delegate literal syntax, |delegate literal types |wrong error message | --- Comment #3 from Kenji Hara <[email protected]> 2013-05-30 03:23:15 PDT --- (In reply to comment #0) > int delegate() foo() { > return () => { > return 1; > }; > } > Also the return type of foo is not int, it is int delegate(). It is not wrong delegate syntax. The code is just equivalent with follows: int delegate() foo() { return (){ return (){ // L3 return 1; }; }; } And reported error is changed to: test.d(3): Error: mismatched function return type inference of int function() pure nothrow @safe and int The outer lambda should return int, because the lambda type should be deduced to int delegate(). But it returns an inner lambda, which has the type "int function() pure nothrow @safe". Then it conflicts with expected return type "int". Reported error message is not wrong, too. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
