Skip to content

Commit 36f1115

Browse files
Keep a ghost definition when an alias may apply the ghost
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 12366b4 commit 36f1115

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker

‎liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker/OriginNotes.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import liquidjava.utils.constants.Keys;
2020
import liquidjava.processor.context.CallResult;
2121
import liquidjava.processor.context.VariableInstance;
22+
import liquidjava.rj_language.ast.AliasInvocation;
2223
import liquidjava.rj_language.ast.BinaryExpression;
2324
import liquidjava.rj_language.ast.Expression;
2425
import liquidjava.rj_language.ast.FunctionInvocation;
@@ -115,9 +116,13 @@ private static Expression withoutGhostDefinitions(Expression refinement, String
115116
return kept;
116117
}
117118

118-
/** Whether {@code expression} applies the function {@code name}, to any arguments */
119+
/**
120+
* Whether {@code expression} may apply the function {@code name}, to any arguments: it does, or it applies an
121+
* alias, whose definition may
122+
*/
119123
private static boolean applies(Expression expression, String name) {
120124
return expression instanceof FunctionInvocation invocation && invocation.getName().equals(name)
125+
|| expression instanceof AliasInvocation
121126
|| expression.getChildren().stream().anyMatch(child -> applies(child, name));
122127
}
123128

0 commit comments

Comments
 (0)