return super.typeCheck(tc);
if (tc.context().currentClass().flags().isInterface()) { if (flags().isProtected() || flags().isPrivate()) { throw new SemanticException("Interface methods must be public.", position()); } }  try { ts.checkMethodFlags(flags()); } catch (SemanticException e) { throw new SemanticException(e.getMessage(), position()); }  if (body == null && ! (flags().isAbstract() || flags().isNative())) { throw new SemanticException("Missing method body.", position()); }  if (body != null && flags().isAbstract()) { throw new SemanticException( "An abstract method cannot have a body.", position()); }  if (body != null && flags().isNative()) { throw new SemanticException( "A native method cannot have a body.", position()); }  for (Iterator i = throwTypes().iterator(); i.hasNext(); ) { TypeNode tn = (TypeNode) i.next(); Type t = tn.type(); if (! t.isThrowable()) { throw new SemanticException("Type \"" + t + "\" is not a subclass of \"" + ts.Throwable() + "\".", tn.position()); } }    if (flags().isStatic() && !JL5Flags.isEnumModifier(methodInstance().container().toClass().flags()) && methodInstance().container().toClass().isInnerClass()) {  throw new SemanticException("Inner classes cannot declare " + "static methods.", this.position()); }  overrideMethodCheck(tc);  return this;
    public Node typeCheck(TypeChecker tc) throws SemanticException {        // check no duplicate annotations used        JL5TypeSystem ts = (JL5TypeSystem)tc.typeSystem();        ts.checkDuplicateAnnotations(annotations);           // check throws clauses are not parameterized        for (Iterator it = throwTypes.iterator(); it.hasNext(); ){            TypeNode tn = (TypeNode)it.next();            Type next = tn.type();            if (next instanceof ParameterizedType){                throw new SemanticException("Cannot use parameterized type "+next+" in a throws clause", tn.position());            }        }                // check at most last formal is variable        for (int i = 0; i < formals.size(); i++){            JL5Formal f = (JL5Formal)formals.get(i);            if (i != formals.size()-1 && f.isVariable()){                throw new SemanticException("Only last formal can be variable in method declaration.", f.position());            }        }        return super.typeCheck(tc);    }