[Bug 180] New: DMD accepts a function with a non-void return type but no return statements

BCS BCS at pathlink.com
Wed Jun 7 09:17:21 PDT 2006


Don Clugston wrote:
> 
> Certainly it should be an error if a function doesn't contain any return 
> statements at all!

void main()
{
	int function() foo = function int()
		{
			throw new Error("Function pointer not set");
		}

	/**
		logic that might not set foo;
	**/

	int i = foo();
}



More information about the Digitalmars-d-bugs mailing list