digitalmars.D - goto case warning
- J Arrizza (40/40) Nov 12 2011 I'm getting an odd error message in line 366 below (this is part of
I'm getting an odd error message in line 366 below (this is part of variant.d): ../utd/variant.d(366): Error: switch case fallthrough - use 'goto case;' if intended But you can see that line 366 already has a "goto case": switch(id) { foreach(i,T; ICT!A ) { static if (is(typeof(*cast(T*) ptr = *src)) ) { // BUG workaround the string <=> immutable(char)[] problem static if((is(T : const(char[])) || is(T : const(wchar[])) || is(T : const(dchar[]))) && T.stringof != (typeof(T.init[0])).stringof~"[]" ) { case (typeof(T.init[0])).stringof~"[]": goto case; } // isImplicitlyConvertible!(T,immutable T) [inlined] static if( !is(immutable T == T) && is(typeof({void fun(immutable(T)){} T f; fun(f);}())) ) { case (immutable T).stringof: goto case; } static if(!is(const(T) == T) && !(i==1&&is(typeof(T.init[]))) ) { case (const T).stringof: goto case; // THIS IS LINE 366 } case ( T).stringof: static if(is(T:Object)) { if(info !is typeid(T) && info !is typeid(const T) && info !is typeid(immutable T) ) continue; } if (src && ptr) *(cast(T*) ptr) = *src; return true; } } Any help is appreciated, thanks John
Nov 12 2011