Ejemplo n.º 1
0
  @Override
  public TCType typeCheck(
      Environment env, TCTypeList qualifiers, NameScope scope, TCType constraint) {
    if (!elseIfExp.typeCheck(env, null, scope, null).isType(TCBooleanType.class, location)) {
      report(3086, "Else clause is not a boolean");
    }

    TCDefinitionList qualified = elseIfExp.getQualifiedDefs(env);
    Environment qenv = env;

    if (!qualified.isEmpty()) {
      qenv = new FlatEnvironment(qualified, env);
    }

    return thenExp.typeCheck(qenv, null, scope, constraint);
  }