N
n_o_s_p_a__m
Can't compile. Does this mean that all functions that throw exceptions
must be of return type void?
examples:
// won't compile: "not all code paths return a value"
public override int Run() {
throw new Exception("exception thrown");
}
// won't compile: "unreachable code detected"
public override int Run() {
return 1;
throw new Exception("exception thrown");
}
// won't compile: "unreachable code detected"
public override int Run() {
throw new Exception("exception thrown");
return 1;
}
must be of return type void?
examples:
// won't compile: "not all code paths return a value"
public override int Run() {
throw new Exception("exception thrown");
}
// won't compile: "unreachable code detected"
public override int Run() {
return 1;
throw new Exception("exception thrown");
}
// won't compile: "unreachable code detected"
public override int Run() {
throw new Exception("exception thrown");
return 1;
}