Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion checker/src/test/java/dev/cel/checker/ExprCheckerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,10 @@ public void referenceTypeAbsolute() throws Exception {
declareVariable("x", SimpleType.STRING);
source = "[1].exists(x, [2].exists(y, .x == 'a'))";
runTest();
}

clearAllDeclarations();
@Test
public void referenceAbsolute_aliasShadowedByComprehension() throws Exception {
declareVariable("b", SimpleType.STRING);
container = CelContainer.newBuilder().addAlias("a", "b").build();
source = "[1].all(b, a == 'a')";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Source: [1].all(b, a == 'a')
declare b {
value string
}
=====>
__comprehension__(
// Variable
b,
// Target
[
1~int
]~list(int),
// Accumulator
@result,
// Init
true~bool,
// LoopCondition
@not_strictly_false(
@result~bool^@result
)~bool^not_strictly_false,
// LoopStep
_&&_(
@result~bool^@result,
_==_(
.b~string^.b,
"a"~string
)~bool^equals
)~bool^logical_and,
// Result
@result~bool^@result)~bool
31 changes: 0 additions & 31 deletions checker/src/test/resources/referenceTypeAbsolute.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -120,34 +120,3 @@ __comprehension__(
)~bool^logical_or,
// Result
@result~bool^@result)~bool

Source: [1].all(b, a == 'a')
declare b {
value string
}
=====>
__comprehension__(
// Variable
b,
// Target
[
1~int
]~list(int),
// Accumulator
@result,
// Init
true~bool,
// LoopCondition
@not_strictly_false(
@result~bool^@result
)~bool^not_strictly_false,
// LoopStep
_&&_(
@result~bool^@result,
_==_(
.b~string^.b,
"a"~string
)~bool^equals
)~bool^logical_and,
// Result
@result~bool^@result)~bool
Loading