Forward reference not working in nested functions

Timon Gehr timon.gehr at gmx.ch
Wed Dec 12 12:03:44 PST 2012


On 12/12/2012 07:03 PM, H. S. Teoh wrote:
> Is this a known bug or deliberate limitation?
>
> 	void func(T)(T data) {
> 		void subfunc1() {
> 			process(data);
> 			if (recurse) subfunc2(); // Error: subfunc2 undefined
> 		}
>
> 		void subfunc2() {
> 			process(data);
> 			if (recurse) subfunc1(); // Error: subfunc1 undefined
> 		}
>
> 		subfunc1();
> 	}
>
>
> T
>

Both.


More information about the Digitalmars-d mailing list