Simplify compilation of array indexing in SpEL's Indexer
This commit is contained in:
@@ -652,6 +652,18 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
assertThat(getAst().getExitDescriptor()).isEqualTo("I");
|
||||
}
|
||||
|
||||
@Test
|
||||
void indexIntoSetCannotBeCompiled() {
|
||||
Set<Integer> set = Set.of(42);
|
||||
|
||||
expression = parser.parseExpression("[0]");
|
||||
|
||||
assertThat(expression.getValue(set)).isEqualTo(42);
|
||||
assertCannotCompile(expression);
|
||||
assertThat(expression.getValue(set)).isEqualTo(42);
|
||||
assertThat(getAst().getExitDescriptor()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void indexIntoStringCannotBeCompiled() {
|
||||
String text = "enigma";
|
||||
|
||||
Reference in New Issue
Block a user