Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
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;
}
}
}
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now