Should this compile?

Meta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 26 13:41:32 PDT 2015


On Wednesday, 26 August 2015 at 20:02:35 UTC, Timon Gehr wrote:
> Another workaround is to order the declarations in the opposite 
> way:
>
> import std.stdio;
> import std.range : chain;
>
> auto test(string a,string b) {
>     return chain(a,b);
> }
> auto test(string a) {
>     return test(a,"b");
> }
> void main() {
>     writeln(test("a"));
> }

It's definitely a bug if the code is dependent on order of 
declaration.


More information about the Digitalmars-d-learn mailing list