Example #1
0
  /** internal reality checks on param/arg kinds */
  private boolean checkKindAgreement(final Type abs, final Type argDeref) {
    final Kind absKind = abs.getKind();

    if (!(absKind instanceof ArrowKind)) {
      Session.error(
          loc,
          "internal error: abs {0} has non-lambda kind {1} in type app {2}",
          abs.dump(),
          absKind.dump(),
          dump());

      return false;
    }

    final Kind paramKind = ((ArrowKind) absKind).getParamKind();
    final Kind argKind = argDeref.getKind();

    if (!paramKind.equals(argKind)) {
      Session.error(
          loc,
          "internal error: param kind {0} incompatible with arg kind {1} in type app {2}",
          paramKind.dump(),
          argKind.dump(),
          dump());

      return false;
    }

    return true;
  }
Example #2
0
 public SubstMap subsume(final Loc loc, final Type other, final TypeEnv env) {
   Session.error(loc, "internal error: TypeParam.subsume()");
   return null;
 }