Trailing commas in constructor arguments?

Gary Willoughby via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 4 03:04:25 PDT 2014


In the following snippet is the line marked WOAH legal? The 
compiler doesn't complain about the trailing comma in the 
constructor arguments.

import std.stdio;

class Foo
{
	public this(string foo)
	{
	}
}

void main(string[] args)
{
	auto foo = new Foo("bar", ); // <-- WOAH
}


More information about the Digitalmars-d-learn mailing list