www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - dmd.120 bug.. compiler error with switch default statments when an

reply dickl <dick221z yahoo.com> writes:
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;
	}
}
Apr 08 2005
next sibling parent Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----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-----
Apr 08 2005
prev sibling parent "Walter" <newshound digitalmars.com> writes:
"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
Apr 09 2005