liquid-java / liquid-java/liquidjava

Change `return` to `$result` for method return values in refinements

Open
#133 3 comments 0 reactions 0 assignees View on GitHub

@rajshivu is already working on this.

Since Feb 9, 2026.

  • #145 by @rajshivu — open
enhancement good first issue
Dominant language
Java
Stars
67
Forks
36
Avg merge
10d 18h
Merged PRs (30d)
3

Description

`return` is a statement, and it's strange to have it as a variable to represent the return value.
Therefore, we could change it for `result`. But since result can be an actual variable that represents something other than the return value we, we can try using `$result`.

This would mean a small change in the grammar, probably, and a change in replacing the return value.
Ps: the _ should still work in any case

Example Before:
```java
@Refinement("return > 0")
int test2 (){
return 10;
}
```
Example After:
```java
@Refinement("$result > 0")
int test2 (){
return 10;
}
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the refinement grammar and the code that replaces or checks return values; the issue mentions both but names no files or tests. Compare the existing `return` and `_` handling with the proposed `$result` syntax, and consider the open pull request before starting. Done means the new syntax works without breaking existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.