Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The 'goto case' value is not implicitly convertible to type 'type'
When you use goto case, there must be an implicit conversion from the value of the goto case to the type of the switch.
Example
The following sample generates CS0469.
// CS0469.cs
// compile with: /W:2
class Test
{
static void Main()
{
char c = (char)180;
switch (c)
{
case (char)127:
break;
case (char)180:
goto case 127; // CS0469
// try the following line instead
// goto case (char) 127;
}
}
}