-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: more progress on classes (#1129)
- Loading branch information
Showing
27 changed files
with
452 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) 2020-2024 Tesla (Yinsen) Zhang. | ||
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file. | ||
package org.aya.tyck.error; | ||
|
||
import org.aya.pretty.doc.Doc; | ||
import org.aya.syntax.concrete.Expr; | ||
import org.aya.util.error.SourcePos; | ||
import org.aya.util.error.WithPos; | ||
import org.aya.util.prettier.PrettierOptions; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public interface ClassError extends TyckError { | ||
@NotNull WithPos<Expr> problemExpr(); | ||
|
||
@Override default @NotNull SourcePos sourcePos() { return problemExpr().sourcePos(); } | ||
|
||
record NotClassCall(@Override @NotNull WithPos<Expr> problemExpr) implements ClassError { | ||
@Override public @NotNull Doc describe(@NotNull PrettierOptions options) { | ||
return Doc.sep(Doc.english("Unable to new a non-class type:"), Doc.code(problemExpr.data().toDoc(options))); | ||
} | ||
} | ||
|
||
record NotFullyApplied(@Override @NotNull WithPos<Expr> problemExpr) implements ClassError { | ||
@Override public @NotNull Doc describe(@NotNull PrettierOptions options) { | ||
return Doc.sep(Doc.english("Unable to new an incomplete class type:"), Doc.code(problemExpr.data().toDoc(options))); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.