Skip to content

Commit

Permalink
misc: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HoshinoTented committed Jun 20, 2024
1 parent 65b798b commit eff3376
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,22 @@
* <li>It can be applied like a function, which essentially inserts the nearest missing field.</li>
* </ul>
*
* As the type of some class instance {@link NewTerm}, the {@param args} may refer to other member
* (not just former members!), therefore the value of members depend on the class instance.
* In order to check a class instance against to a ClassCall, you need to supply the class instance
* to obtain the actual arguments of the ClassCall, see {@link #args(Term)}
*
* @author kiva, ice1000
*/
public record ClassCall(
@NotNull ClassDefLike ref,
@Override int ulift,
@NotNull ImmutableSeq<Closure> args
) implements StableWHNF, Formation {
public @NotNull ImmutableSeq<Term> args(@NotNull Term self) {
return this.args.map(x -> x.apply(self));

Check warning on line 35 in syntax/src/main/java/org/aya/syntax/core/term/call/ClassCall.java

View check run for this annotation

Codecov / codecov/patch

syntax/src/main/java/org/aya/syntax/core/term/call/ClassCall.java#L35

Added line #L35 was not covered by tests
}

public @NotNull ClassCall update(@NotNull ImmutableSeq<Closure> args) {
return this.args.sameElements(args, true)
? this : new ClassCall(ref, ulift, args);
Expand Down

0 comments on commit eff3376

Please sign in to comment.