A
Andy Fish
The following code:
enum Foo { one, two };
int Bar(Foo foo)
{
switch (foo)
{
case Foo.one:
return 7;
case Foo.two:
return 4;
}
}
gives a compilation warning "not all paths return a value"
surely this is spurious though? - there is no path I can see that does not
return a value
Andy
enum Foo { one, two };
int Bar(Foo foo)
{
switch (foo)
{
case Foo.one:
return 7;
case Foo.two:
return 4;
}
}
gives a compilation warning "not all paths return a value"
surely this is spurious though? - there is no path I can see that does not
return a value
Andy