All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aya.tyck.error.PrimProblem Maven / Gradle / Ivy

There is a newer version: 0.33.0
Show newest version
package org.aya.tyck.error;

import org.aya.api.distill.DistillerOptions;
import org.aya.api.error.Problem;
import org.aya.concrete.stmt.Decl;
import org.aya.pretty.doc.Doc;
import org.aya.util.error.SourcePos;
import org.jetbrains.annotations.NotNull;

public sealed interface PrimProblem extends Problem {

  @Override default @NotNull Severity level() {
    return Severity.ERROR;
  }

  record NoResultTypeError(@NotNull Decl.PrimDecl prim) implements PrimProblem {
    @Override public @NotNull Doc describe(@NotNull DistillerOptions options) {
      return Doc.sep(prim.toDoc(options),
        Doc.english("is expected to have a type"));
    }

    @Override public @NotNull SourcePos sourcePos() {
      return prim.sourcePos();
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy