Thread overview
dmd.120 bug.. compiler error with switch default statments when an auto class is used
Apr 08, 2005
dickl
Apr 08, 2005
Thomas Kuehne
Apr 09, 2005
Walter
April 08, 2005
The following gives a compiler error message
test.d(23): switch statement already has a default

The error goes away if class T is not an auto class or the destructor is removed.

The compiler still complains about the default case even if the default case is removed from the switch statement.

This wasn't a problem until .120.
==================================

auto class T
{

	public:

	this(){}
	~this(){}
}



int main()
{

	auto T t=new T();
	int i=1;
	switch(i)
	{
		case 1:
		break;

		default:
		break;
	}
}
April 08, 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

dickl schrieb am Fri, 08 Apr 2005 13:51:27 -0400:
> The following gives a compiler error message
> test.d(23): switch statement already has a default
>
> The error goes away if class T is not an auto class or the destructor is removed.
>
> The compiler still complains about the default case even if the default case is removed from the switch statement.
>
> This wasn't a problem until .120.
>==================================
>
> auto class T
> {
>
> 	public:
>
> 	this(){}
> 	~this(){}
> }
>
>
>
> int main()
> {
>
> 	auto T t=new T();
> 	int i=1;
> 	switch(i)
> 	{
> 		case 1:
> 		break;
>
> 		default:
> 		break;
> 	}
> }

Added to DStess as
http://dstress.kuehne.cn/run/switch_19.d
http://dstress.kuehne.cn/run/switch_20.d
http://dstress.kuehne.cn/run/switch_21.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFCVtoX3w+/yD4P9tIRAof9AJ9OVx1l79us4WPG0FICSJB8WjMkrQCgi++6
kvCNaGgMULWO0Aj+wrVNaUQ=
=2MAo
-----END PGP SIGNATURE-----
April 09, 2005
"dickl" <dick221z@yahoo.com> wrote in message news:d36gav$31fo$1@digitaldaemon.com...
> The following gives a compiler error message
> test.d(23): switch statement already has a default

Fixed. Thanks, -Walter