@Override public void scope(final Scope scope) { super.scope(scope); if (getOptTypeRelation() != null) { getOptTypeRelation().scope(scope); } if (getOptInitializer() != null) { getOptInitializer().scope(scope); } }
@Override public void analyze(AstNode parentNode) { super.analyze(parentNode); if (getOptTypeRelation() != null) { getOptTypeRelation().analyze(this); if (isRest() && !"Array".equals(getOptTypeRelation().getType().getSymbol().getText())) { // todo replace that condition with real Array definition lookup throw Jooc.error(getOptTypeRelation().getSymbol(), "Rest parameter must have Array type."); } } if (getOptInitializer() != null) { getOptInitializer().analyze(this); if (!getOptInitializer().getValue().isCompileTimeConstant()) { throw Jooc.error( getOptInitializer().getSymbol(), "Parameter initializer must be compile-time constant."); } } }