Re: Forward declaration issue

2015-12-04 Thread Andre via Digitalmars-d-learn
On Friday, 4 December 2015 at 09:51:30 UTC, Artur Skawina wrote: No, it's how D is designed -- inside functions the order of declarations matters (and forward declarations don't work). Your version wrongly declares another `baz` at module scope, and, as there's no definition, you end up with

Re: Forward declaration issue

2015-12-04 Thread Artur Skawina via Digitalmars-d-learn
On 12/04/15 09:12, Andre via Digitalmars-d-learn wrote: > Hi, > > I have a strange issue with following coding. > > void baz(); // forward declaration > > void foo() > { > void bar() > { > baz(); // (1) without f.d. syntax error > } > > void baz() > { > b

Re: Forward declaration issue

2015-12-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, December 04, 2015 08:12:05 Andre via Digitalmars-d-learn wrote: > Hi, > > I have a strange issue with following coding. > > void baz(); // forward declaration > > void foo() > { > void bar() > { > baz(); // (1) without f.d. syntax error > } > > void baz() > { > bar(