'result' is not bound in the body of this method

A method must return a result, but here no result is specified.

Example error and correction

class A extends RefType {
  string foo() { this.getPackage().hasName("abc") }
}
The method foo is supposed to return a string, but the body does not say what the value of that string might be. In this example, it looks like the author of the class only wanted to return a result when this is in a particular package. A correction is
class A extends RefType {
  string foo() { this.getPackage().hasName("abc") 
                  and 
                  result=this.getName()}
}
Comments
Only registered users can write comments!
 
< Prev   Next >